Displacement measuring apparatus

ABSTRACT

To enable short-time measurement of a displacement at a predetermined position of a measurement object even when the position or the posture of the measurement object is changed. During operation of a displacement measuring apparatus, the position and the posture of a measurement object are determined by using position correction information, and a measurement position is corrected. The corrected measurement position is irradiated with measurement light. The measurement light that is emitted to and is reflected back from the measurement position is received by a light receiver. The light receiver outputs a received-light quantity distribution for displacement measurement, and a displacement at the measurement position is measured on the basis of the received-light quantity distribution.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application claims foreign priority based on Japanese PatentApplication No. 2018-211017, filed Nov. 9, 2018, the contents of whichis incorporated herein by reference.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention relates to a displacement measuring apparatus thatmeasures a displacement at a predetermined position of a measurementobject.

2. Description of Related Art

A three-dimensional measuring method using the principle oftriangulation, generally called a “light section method”, isconventionally known (e.g., JP-A-2000-193428). In this method,strip-shaped measurement light is emitted to a surface of a measurementobject in such a way that the measurement object is cut, and light thatis reflected back from the surface of the measurement object is receivedby a light receiving element, whereby height information is obtained.JP-A-2000-193428 discloses an apparatus that scans a measurement objectin a stationary state by emitting measurement light in a directionperpendicular to an extending direction of the measurement light, tomeasure a three-dimensional shape of the measurement object.

A pattern projection method is also known as the three-dimensionalmeasuring method.

In the case of the pattern projection method, a pattern projectionoptical system, such as a digital mirror device (DMD), is provided to ameasuring apparatus.

SUMMARY OF THE INVENTION

The apparatus disclosed in JP-A-2000-193428 scans the whole measurementobject by using measurement light to measure a three-dimensional shapeof the measurement object, and therefore, a time required from start tofinish the measurement tends to be prolonged.

To shorten the measurement time of the apparatus in JP-A-2000-193428, ascanning range of the measurement light should be narrowed. However, insome cases, the position and the posture of a measurement object may notbe constant and may be changed in an actual measurement site of themeasurement object. When the position or the posture of a measurementobject is changed in the condition in which the scanning range of themeasurement light is narrow, a measurement position of the measurementobject does not come into the preliminarily set scanning range,resulting in failure of measurement or incorrect measurement.

The present invention has been achieved in view of these circumstances,and an object of the present invention is to enable short-timemeasurement of a displacement at a predetermined position of ameasurement object even when the position or the posture of themeasurement object is changed.

To achieve the above-described object, a first aspect of the inventionprovides a displacement measuring apparatus for measuring a displacementat a predetermined position of a measurement object. The displacementmeasuring apparatus includes a light projector, a scanning part, a lightreceiver, a luminance image generator, a setting unit, a correctioninformation storage, a position corrector, a measurement controller, anda displacement measuring unit. The light projector includes ameasurement light source and a light projection lens that receives lightfrom the measurement light source. The light projector is configured toemit strip-shaped measurement light extending in a first direction, tothe measurement object. The scanning part is configured to performscanning using the measurement light in a second direction crossing thefirst direction. The light receiver includes a two-dimensional lightreceiving element. The two-dimensional light receiving element isconfigured to output a received-light quantity distribution fordisplacement measurement in response to receiving the measurement lightthat is reflected back from the measurement object. The two-dimensionallight receiving element is further configured to output a received-lightquantity distribution for image generation or for luminance measurementin response to receiving light that is reflected back from themeasurement object. The luminance image generator is configured togenerate a luminance image of the measurement object on the basis of thereceived-light quantity distribution for image generation or forluminance measurement. The setting unit is configured to receive settingof a measurement position at which a displacement is measured in a rangescannable by the scanning part. The setting unit is further configuredto receive setting of a region for position correction, by which themeasurement position is corrected, in the luminance image generated bythe luminance image generator. The correction information storage isconfigured to store position correction information in the region andstore relative position information between the region and themeasurement position set by the setting unit. In operating thedisplacement measuring apparatus, the position corrector is configuredto determine a position and a posture of the measurement object by usingthe position correction information stored in the correction informationstorage, in a luminance image that is newly generated by the luminanceimage generator, to correct the measurement position by using therelative position information. The measurement controller is configuredto control the light projector and the scanning part to cause themeasurement light to irradiate the measurement position that iscorrected by the position corrector. The displacement measuring unit isconfigured to measure the displacement at the measurement position on abasis of the received-light quantity distribution for displacementmeasurement. The received-light quantity distribution for displacementmeasurement is output from the light receiver when the light receiverreceives the measurement light that is emitted to and is reflected backfrom the measurement position corrected by the position corrector.

With this structure, light that is reflected back from the measurementobject is received by the light receiver, and the light receiver thenoutputs the received-light quantity distribution for luminancemeasurement, whereby a luminance image is generated. In response tosetting a region for position correction, which is used to correct ameasurement position, in the generated luminance image, the set regionand position correction information in the region are stored in thecorrection information storage in conjunction with position informationbetween the set region and the position correction information in theset region. The position correction information may be, for example,luminance information showing an image itself, or edge information ofthe measurement object, such as a shape of an edge, a length of an edge,or the number of edges. In addition, luminance information forcorrection using normalized correlation may also be used.

During operation of the displacement measuring apparatus, a luminanceimage is newly generated by the luminance image generator, and theposition and the posture of the measurement object contained in thisluminance image differ each time, in some cases. In such cases, theposition and the posture of the measurement object are determined byusing the position correction information in the luminance image that isnewly generated by the luminance image generator, and the measurementposition is corrected by using the relative position information.Thereafter, the measurement controller controls the light projector andthe scanning part to cause the measurement light to irradiate thecorrected measurement position. Thus, the corrected measurement positionis irradiated with the measurement light. The measurement light that isemitted to the corrected measurement position and is reflected back fromthe corrected measurement position is received by the light receiver. Onthe basis of the received-light quantity distribution for displacementmeasurement output from the light receiver, a displacement at thecorrected measurement position is measured. The principle of measuringthe displacement of the measurement position may employ the principle oftriangulation that is conventionally known.

Thus, a displacement at a predetermined position of the measurementobject is measured even though the position or the posture of themeasurement object is changed.

A part to be scanned with the measurement light may be set at multiplepositions of the measurement object. The light projector and thescanning part may be controlled to cause the measurement light to scanthe whole measurement object, as necessary.

The scanning part can be constituted of, for example, a MEMS mirror, agalvanometer mirror, or a mirror that is turned by a stepping motor. The“MEMS” is an abbreviation of “Micro Electro Mechanical Systems” and is agenerally called “micro electro mechanical system”.

A light receiving unit that outputs a received-light quantitydistribution for displacement measurement in response to receiving themeasurement light reflected back from the measurement object may beprovided. Simultaneously, a light receiving unit that outputs areceived-light quantity distribution for luminance measurement inresponse to receiving the illumination light reflected back from themeasurement object may also be provided. The light receiver of thepresent invention may be constituted of these light receiving units thatare provided separately from each other. Alternatively, the lightreceiver of the present invention may be constituted of a single lightreceiving unit that outputs a received-light quantity distribution fordisplacement measurement in response to receiving the measurement lightreflected back from the measurement object and that also outputs areceived-light quantity distribution for luminance measurement inresponse to receiving the illumination light reflected back from themeasurement object. The measurement position that is set by the settingunit is not limited to a position corresponding to one pixel in theluminance image. The measurement position may be a positioncorresponding to multiple pixels and having a predetermined area or aregion.

According to a second aspect of the invention, the position correctioninformation may be a part of the luminance image.

This structure enables determining the position and the posture of themeasurement object by using a preliminarily obtained luminance imageitself. The image to be used for determining the position and theposture of the measurement object can also be called a “template image”.

According to a third aspect of the invention, the position correctioninformation may be edge information of the luminance image.

This structure enables determining the position and the posture of themeasurement object by using edge information of a preliminarily obtainedluminance image. The luminance image may be or may not be stored in thecorrection information storage.

According to a fourth aspect of the invention, the displacementmeasuring apparatus may further include an edge extracting unitconfigured to extract an edge of the measurement object in the luminanceimage, and the position correction information may be edge informationrelating to the edge extracted by the edge extracting unit.

With this structure, edge information of the measurement object is used,thereby determining the position and the posture of the measurementobject at a high speed and with less measurement error. The luminanceimage may be or may not be stored in the correction information storage.The edge information may contain a linear component, and the linercomponent may be used to determine the position and the posture of themeasurement object.

According to a fifth aspect of the invention, the displacement measuringapparatus may further include a display configured to display the edge,which is extracted by the edge extracting unit, in a manner superimposedon the luminance image.

This structure allows a user to visually check the edge, which isextracted by the edge extracting unit, in the luminance image.

According to a sixth aspect of the invention, the setting unit may beconfigured to set a displacement measurement range in which adisplacement at the measurement position is measured. In this case, thedisplacement measuring apparatus may further include a display that isconfigured to display the luminance image so that an X coordinate in theluminance image is a coordinate in the first direction whereas a Ycoordinate in the luminance image is a coordinate in the seconddirection. The measurement controller may be configured to control thelight projector and the scanning part to cause the measurement light toirradiate the measurement position that is corrected by the positioncorrector, on the basis of the Y coordinate of the measurement positioncorrected by the position corrector as well as the displacementmeasurement range set by the setting unit.

With this structure, the measurement position is corrected, and thedisplacement measurement range is set. Thus, it is not necessary to scanin the whole maximum scanning range, resulting in shortening the time toobtain the displacement of the measurement position.

According to a seventh aspect of the invention, the measurementcontroller may be further configured to control the light projector andthe scanning part on the basis of the X coordinate of the measurementposition corrected by the position corrector as well as the displacementmeasurement range set by the setting unit.

According to an eighth aspect of the invention, the displacementmeasuring apparatus may further include an illuminator configured toemit uniform illumination light to the measurement object. In this case,after the illuminator emits the uniform illumination light to themeasurement object, and the luminance image generator generates theluminance image of the measurement object, the light projector may emitthe measurement light to the measurement object, and the light receivermay output the received-light quantity distribution for displacementmeasurement. After the position corrector determines the position andthe posture of the measurement object by using the position correctioninformation stored in the correction information storage, in theluminance image newly generated by the luminance image generator, andthe position corrector corrects the measurement position by using therelative position information, the measurement controller may controlthe light projector and the scanning part to cause the measurement lightto irradiate the measurement position corrected by the positioncorrector.

With this structure, after a luminance image is generated first, theposition and the posture of the measurement object are determined byusing the position correction information, in the generated luminanceimage, and the measurement position is corrected by using the relativeposition information. Thereafter, the corrected measurement position isirradiated with the measurement light. After the measurement light thatis reflected back from the measurement object is received by the lightreceiver, the light receiver outputs the received-light quantitydistribution for displacement measurement. On the basis of thisreceived-light quantity distribution, the displacement of themeasurement position is measured.

According to a ninth aspect of the invention, the displacement measuringapparatus may further include a display configured to display theluminance image generated by the luminance image generator. In thiscase, the setting unit may be configured to receive setting of themeasurement position at which the displacement is measured and receivesetting of a region for position correction by which the measurementposition is corrected, in the luminance image displayed on the display.

This structure allows a user to set a measurement position and set aregion for position correction while looking at the luminance imagedisplayed on the display, thereby providing good operability.

In the present invention, during operation of the displacement measuringapparatus, the position and the posture of the measurement object aredetermined by using the position correction information, and themeasurement position is corrected. The measurement light is emitted tothe corrected measurement position to measure a displacement at thecorrected measurement position. Thus, a displacement at a predeterminedposition of the measurement object is measured for a short time evenwhen the position or the posture of the measurement object is changed.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic explanatory diagram showing an operation situationof a displacement measuring apparatus according to an embodiment of thepresent invention;

FIG. 2 is a perspective view of a sensor head as viewed from a lowerside;

FIG. 3 is a partially transparent view showing an inside structure ofthe sensor head with a side cover removed;

FIG. 4 is a side view of the sensor head with the side cover removed;

FIG. 5 is an exploded perspective view of an optical system of thesensor head;

FIG. 6 corresponds to FIG. 2 and shows a state in which a polarizationfilter attachment is attached;

FIG. 7 is a block diagram of the displacement measuring apparatus;

FIG. 8A shows an example of using a half mirror to split light intolight for a displacement measurement light receiver and light for aluminance measurement light receiver;

FIG. 8B shows an example of making light enter each of the displacementmeasurement light receiver and the luminance measurement light receiver;

FIGS. 9A and 9B are schematic diagrams for explaining a displacementmeasurement principle employed by the displacement measuring apparatus;

FIG. 10 shows a user interface showing a luminance image;

FIG. 11 corresponds to FIG. 10 and shows a state in which a measurementposition is set by using a height tool;

FIG. 12 corresponds to FIG. 10 and shows a state in which a displacementmeasurement range is set by using the height tool;

FIG. 13 corresponds to FIG. 10 and shows a state in which edgeextraction is performed to the luminance image in a scanning mode;

FIG. 14 corresponds to FIG. 10 and shows a state in which the edgeextraction is performed with respect to a height profile in a line mode;

FIG. 15 shows a measurement tool selection interface;

FIG. 16 corresponds to FIG. 15 and illustrates a case of selecting oneof measurement tools in which measurement regions differ from eachother;

FIGS. 17A to 17D are diagrams for explaining change of a scanning rangeof measurement light;

FIG. 17A shows a case of scanning the whole region in a Z-direction byusing measurement light in measuring a measurement object at a firstposition;

FIG. 17B shows a case of scanning a narrow range in the Z-direction byusing the measurement light in measuring the measurement object at thefirst position;

FIG. 17C shows a case of scanning the whole region in the Z-direction byusing the measurement light in measuring a measurement object at asecond position;

FIG. 17D shows a case of scanning a narrow range in the Z-direction byusing the measurement light in measuring the measurement object at thesecond position;

FIGS. 18A and 18B show situations in which scanning is performed withthe measurement light, as viewed from above;

FIG. 18A shows a case in which a measurement object is at a firstposition;

FIG. 18B shows a case in which a measurement object is at a secondposition;

FIGS. 19A and 19B are diagrams for explaining change of a tool size ofthe height tool;

FIG. 19A shows a case in which the tool size is large;

FIG. 19B shows a case in which the tool size is small;

FIG. 20 is a drawing for explaining a scanning order of set multiplemeasurement positions;

FIGS. 21A and 21B show a distribution of quantity of light that isreceived by the displacement measurement light receiver;

FIG. 22 shows contents of a first program;

FIG. 23 shows contents of a second program;

FIG. 24 shows contents of a third program;

FIG. 25 is a flowchart in the scanning mode;

FIG. 26 shows a luminance image that is obtained in the scanning mode;

FIG. 27 is a master registration flowchart in the scanning mode;

FIG. 28 shows an image displayed on a display in master registration inthe scanning mode;

FIG. 29 is a flowchart in a case of using master height data;

FIG. 30 shows an image displayed on the display in a case of selecting aheight difference tool;

FIG. 31 shows an image displayed on the display in a case of setting adisplacement measurement range of the height difference tool;

FIG. 32 shows an image displayed on the display in a case of selectingan area tool;

FIG. 33 shows an image displayed on the display when settings ofmeasurement tools are finished;

FIG. 34 shows a setting screen for output assignment in the scanningmode;

FIG. 35 shows a setting screen for a comprehensive determinationcondition in the scanning mode;

FIG. 36 is a flowchart showing a processing procedure for decreasinghalation;

FIG. 37 is a flowchart showing a processing procedure for obtaining apeak position;

FIG. 38 shows a reference plane setting screen in correctinginclination;

FIG. 39 shows a screen after the reference plane is set;

FIG. 40 shows a screen after the inclination is corrected;

FIGS. 41A to 41C are diagrams for explaining a method of optimizing anirradiation pitch of the measurement light in accordance with adirection of the reference plane;

FIGS. 42A and 42B are diagrams for explaining an overview of correctinga height of a reference plane;

FIG. 43 shows a setting screen of a designated-height area tool;

FIG. 44 shows a state in which first designation of an extraction partis received;

FIG. 45 shows a state in which second designation of an extraction partis received;

FIG. 46 is a flowchart showing a processing procedure for setting thedesignated-height area tool;

FIG. 47 is a flowchart of operation in the scanning mode;

FIG. 48 is a basic flowchart of approximate searching and precisemeasurement processing;

FIG. 49 is a flowchart of the approximate searching and the precisemeasurement processing in which multiple patterns are executedalternately;

FIG. 50 is a flowchart of the approximate searching and the precisemeasurement processing in which multiple patterns are executed in theapproximate searching prior to the precise measurement processing;

FIG. 51 is a flowchart of the approximate searching and the precisemeasurement processing in which multiple patterns are executedsimultaneously in the approximate searching;

FIG. 52 is a flowchart of the approximate searching and the precisemeasurement processing in which the procedure advances to the precisemeasurement at the time height information of a measurement object isobtained during the approximate searching;

FIG. 53 is a flowchart of the approximate searching and the precisemeasurement processing in which a measurement position is determinedfrom both results of the approximate searching and the precisemeasurement;

FIG. 54 is a flowchart in the line mode;

FIG. 55 shows a user interface showing a luminance image in the linemode.

FIG. 56 corresponds to FIG. 55 and shows a state in which thedisplacement measurement range is set by using the height tool;

FIG. 57 corresponds to FIG. 55 and shows a state in which thedisplacement measurement range is set by using the height differencetool;

FIG. 58 is a master registration flowchart in the line mode; and

FIG. 59 is a flowchart of operation of the line mode.

DESCRIPTION OF EMBODIMENTS

Embodiments of the present invention are explained in detail below withreference to the drawings. However, the following descriptions of theembodiments are substantially only illustrations and are not intended tolimit the present invention, objects using the present invention, anduse of the present invention.

FIG. 1 is a schematic diagram showing an operation situation of adisplacement measuring apparatus 1 according to an embodiment of thepresent invention. The displacement measuring apparatus 1 is anapparatus or a system that measures a displacement of a predeterminedposition of a measurement object W. The displacement measuring apparatus1 can be simply called a “displacement meter” or can also be calledanother name such as “distance measuring meter” or “height displacementmeter”. Although details are described later, the displacement measuringapparatus 1 that is used in a scanning mode for scanning withmeasurement light can also be called an “apparatus including an imagesensor added with a displacement meter” or an “apparatus including adisplacement meter that measures a variable part”. In this embodiment, adisplacement at each part of the measurement object W may be measured,and thus, the displacement measuring apparatus 1 can also be called a“three-dimensional measuring system”. In addition, the displacementmeasurement is also called “height measurement” in this embodiment.

FIG. 1 shows a situation in which a measurement object W is conveyed bya conveying device, such as a belt conveyor B for conveyance, that is, asituation in which the measurement object W is moved. However, thesituation is not limited to that shown in FIG. 1, and the measurementobject W may remain stationary. The number of the measurement objects Wthat are able to be measured at once is one or multiple, anddisplacements of predetermined positions of multiple measurement objectsW may be measured at once. The type of the measurement object W is notspecifically limited.

Overall Configuration of Displacement Measuring Apparatus 1

In the example shown in FIG. 1, the displacement measuring apparatus 1includes multiple sensor heads 2, a slave amplifier 3, a masteramplifier 4, and a monitor device 5A or a personal computer 5B as asetting device 5. The sensor head 2 may be one. In a case in which thesetting device 5 is not necessary, one sensor head 2 and one masteramplifier 4 are used in a minimum configuration. A system having theslave amplifier 3 and the master amplifier 4 that are integrated to eachother may be used.

The sensor head 2 is connected to the slave amplifier 3 or the masteramplifier 4 via a connection line 2 a in a mutually communicable manner.The slave amplifier 3 is not operable alone but is operable by beingconnected to the master amplifier 4 and receiving power supply from themaster amplifier 4. The slave amplifier 3 and the master amplifier 4 aremutually communicable. Multiple slave amplifiers 3 may be connected tothe master amplifier 4. In this embodiment, only the master amplifier 4is provided with an Ethernet connector, and both the master amplifier 4and the slave amplifier 3 are communicable with the monitor device 5A orthe personal computer 5B via the Ethernet connector. In one example, theslave amplifier 3 may not be used, or the function of the slaveamplifier 3 may be incorporated in the master amplifier 4, to use onlyone amplifier. In another example, the functions of the slave amplifier3 and the master amplifier 4 may be incorporated in the sensor head 2 todispense with the slave amplifier 3 and the master amplifier 4. TheEthernet connector may also be provided to the slave amplifier 3 inaddition to the master amplifier 4.

An external device 6 may be, for example, a programmable logiccontroller (PLC). The PLC is a controller for sequentially controllingthe belt conveyor B for conveyance and the displacement measuringapparatus 1. The PLC can use a general-purpose device. FIG. 1 showsmerely an example of a system configuration of the displacementmeasuring apparatus 1. The present invention is not limited to thisexample, and the master amplifier 4 and the slave amplifier 3 may beequipped with an input-output (I/O) unit to be directly connected to theexternal device 6. In this case, a physical signal, such as a triggersignal or a result output signal, is transferred between the masteramplifier 4 or the slave amplifier 3 and the external device 6. Themaster amplifier 4 may also be provided with an analog output. Themaster amplifier 4 and the slave amplifier 3 may communicate with theexternal device 6 via the Ethernet connector. This communication may bemade by using a publicly known communication protocol of each type, suchas Ethernet/IP or PROFINET.

The displacement measuring apparatus 1 receives a measurement starttrigger signal that defines a measurement start timing, via theconnection line 6 a from the external device 6 during operation. Thedisplacement measuring apparatus 1 performs displacement measurement andpass/fail determination in response to the measurement start triggersignal. The results of the displacement measurement and the pass/faildetermination may be transmitted to the external device 6 via theconnection line 6 a.

During operation of the displacement measuring apparatus 1, input of themeasurement start trigger signal and output of the result are repeatedlyperformed via the connection line 6 a between the displacement measuringapparatus 1 and the external device 6. The input of the measurementstart trigger signal and the output of the result may be performed viathe connection line 6 a that connects the displacement measuringapparatus 1 and the external device 6, as described above, or may beperformed via a communication line, which is not shown in the drawing,instead of the connection line 6 a. For example, a sensor (not shown)that detects arrival of a measurement object W and the displacementmeasuring apparatus 1 may be directly connected to each other, and themeasurement start trigger signal may be input from the sensor to thedisplacement measuring apparatus 1. The displacement measuring apparatus1 may be operated in response to an internal trigger that is generatedtherein. Thus, the displacement measuring apparatus 1 may have a modefor issuing an internal trigger at regular intervals.

One of the monitor device 5A and the personal computer 5B is connectedto the master amplifier 4 via a connection line 5 a in a mutuallycommunicable manner. However, both of the monitor device 5A and thepersonal computer 5B may be connected to the master amplifier 4. Themonitor device 5A and the personal computer 5B are controllers forsetting various conditions of the displacement measuring apparatus 1 andfor controlling the displacement measuring apparatus 1. Simultaneously,the monitor device 5A and the personal computer 5B are display devicesfor displaying an image imaged by the sensor head 2, a post-processedimage, various kinds of measurement values, measurement results,determination results, and other information. The monitor device 5A is adedicated component, whereas the personal computer 5B can use ageneral-purpose component. Of course, the monitor device 5A can use ageneral-purpose component such as a programmable display.

Communication between the sensor head 2 and the slave amplifier 3 or themaster amplifier 4, communication between the master amplifier 4 and themonitor device 5A or the personal computer 5B, and communication betweenthe master amplifier 4 and the external device 6 may be performed bywired communication or wireless communication. The master amplifier 4has a communication unit that uses, but is not limited to, EtherNet/IP,PROFINET, CC-Link, DeviceNet, EtherCAT, PROFIBUS, BCD, RS-232C, or othertype of network system.

Monitor Device 5A and Personal Computer 5B

Each of the monitor device 5A and the personal computer 5B has a display8 constituted of a display device such as a liquid crystal display or anorganic EL display. The display 8 displays an image imaged by the sensorhead 2, an image generated by the slave amplifier 3 or the masteramplifier 4, each type of an interface, and other information.

The monitor device 5A includes a touch-panel input unit 9, which isshown in FIG. 7. The monitor device 5A receives input operation thatshows the position touched on the display 8 by a user. The personalcomputer 5B includes an input unit 9 constituted of a keyboard, a mouse,a touch pad, a touch panel, or other unit. This input unit 9 is shown inFIG. 7. As in the case of the monitor device 5A, the personal computer5B receives input operation. The touch operation may be an operationusing a stylus or an operation with a finger, for example.

Structure of Sensor Head 2

As shown in FIGS. 3 and 4, the sensor head 2 includes a light projectionmodule 10, an angle measuring sensor 22, an illuminator 30, adisplacement measurement light receiver 40, and a housing 50. The lightprojection module 10 emits measurement light that irradiates ameasurement object W. The illuminator 30 makes uniform illuminationlight irradiate the measurement object W. The displacement measurementlight receiver 40 receives the measurement light that is reflected backfrom the measurement object W. The light projection module 10, the anglemeasuring sensor 22, the illuminator 30, and the displacementmeasurement light receiver 40 are contained in the housing 50. Althoughthe up-down direction of the sensor head 2 is specified in FIGS. 2 to 5,this direction is described merely for convenience of explanation anddoes not limit the posture of the sensor head 2 during operation, andthe sensor head 2 is used in any direction and in any posture.

As shown in FIG. 7, the sensor head 2 includes an amplifier communicator20 and a trigger detector 21. The amplifier communicator 20 communicateswith the slave amplifier 3 and the master amplifier 4 and causestransmission and reception of a signal between the sensor head 2 and theslave amplifier 3 or the master amplifier 4. The trigger detector 21detects a trigger signal output from the slave amplifier 3 or the masteramplifier 4. Upon detecting the trigger signal, the trigger detector 21outputs a signal to each part of the sensor heads 2 to cause measurementof a displacement. In this embodiment, the sensor head 2 detects thetrigger signal output from the slave amplifier 3 or the master amplifier4. Alternatively, the sensor head 2 may generate the trigger signalautomatically, for example, in a line mode described later. In thiscase, the sensor head 2 may also have a trigger signal generator thatgenerates the trigger signal.

Structure of Housing 50

As shown in FIGS. 2 and 3, the housing 50 is formed into an elongatedshape as a whole. The light projection module 10 is fixed to the housing50 in a condition of being closer to one side in a longitudinaldirection in the housing 50. The one side in the longitudinal directionof the housing 50 is a right side in FIG. 4. The illuminator 30 and thedisplacement measurement light receiver 40 are fixed to the housing 50in a condition of being closer to the other side in the longitudinaldirection in the housing 50. The other side in the longitudinaldirection of the housing 50 is a left side in FIG. 4.

As shown in FIG. 2, the housing 50 has an end wall 51 that extends inthe longitudinal direction. The end wall 51 is provided with ameasurement light projection window 51 a and a light reception window 51b. The measurement light projection window 51 a passes the measurementlight emitted from the light projection module 10. The light receptionwindow 51 b receives the illumination light reflected back from ameasurement object W. The measurement light projection window 51 a andthe light reception window 51 b are covered with transparent members.Moreover, the light reception window 51 b passes the illumination lightfrom the illuminator 30. The “transparent member” may be a transparentor semitransparent band pass filter.

Polarization Filter

As shown in FIG. 6, the housing 50 is configured so that polarizationfilters 52 a are attachable to a first region facing a condensingoptical system 41 and a second region facing light emitting diodes 31 to34 at the light reception window 51 b while polarization componentsdiffer by 90 degrees between in the first region and in the secondregion. The example shown in FIG. 6 is a case of attaching apolarization filter attachment 52 having polarization filters 52 a so asto cover the end wall 51 of the housing 50. The polarization filterattachment 52 is removably attached to the housing 50 by fitting claws,by using a tightening member such as a screw, or by other securingmethod. The polarization filter attachment 52 may be used depending onsurrounding circumstances, a surface state of the measurement object W,and other factors. Specifically, in a case in which halation occurs,using the polarization filter attachment 52 enables removing halation.

The polarization component of the polarization filter 52 a to beattached to the first region may be made parallel to a polarizationcomponent of the measurement light. This minimizes decrease in quantityof measurement light. Specifically, in the condition in which themeasurement light has a uniform polarizing direction, a polarizationfilter is fitted to the light reception window 51 b in the first region,in parallel to the polarizing direction of the measurement light.

Structure of Light Projection Module 10

As shown in FIG. 3, the light projection module 10 includes a lightprojector 10 a, a MEMS mirror 15 being a scanning part, and amodularization member 10 b to which the light projector 10 a and theMEMS mirror 15 are mounted. The light projector 10 a includes a laseroutput unit 12 as a measurement light source and has a collimator lens13 and a cylindrical lens 14 that receive light from the laser outputunit 12. The light projector 10 a generates strip-shaped measurementlight that extends in a first direction shown in FIG. 3 and makes thegenerated measurement light irradiate the measurement object W. Themeasurement light source may be a light source other than the laseroutput unit 12.

The laser output unit 12, the collimator lens 13, and the cylindricallens 14 are fixed to the modularizing member 10 b to prevent changing ofthe relative positional relationship between the laser output unit 12,the collimator lens 13, and the cylindrical lens 14. The collimator lens13 is disposed closer to the laser output unit 12 than the cylindricallens 14. The collimator lens 13 collimates rays of the measurement lightoutput from the laser output unit 12. The cylindrical lens 14 isdisposed so as to have a major axis in the first direction. Thecylindrical lens 14 receives the measurement light emitted from thecollimator lens 13 and generates the strip-shaped measurement lightextending in the first direction. Thus, the measurement light that isoutput from the laser output unit 12 is collimated when it passesthrough the collimator lens 13, and the measurement light then entersthe cylindrical lens 14 to be changed to the strip-shaped measurementlight extending in the first direction. The collimator lens 13 and thecylindrical lens 14 have a diaphragm 16 that is disposed therebetween.The collimator lens 13 and the cylindrical lens 14 are examples of lightprojection lens. The structure of the light projection lens is notlimited to that described above.

As shown in FIG. 7, the sensor head 2 includes a laser controller 12 a.The laser controller 12 a executes control of output and stop of laserlight from the laser output unit 12. This control will be specificallydescribed later.

Structure of MEMS Mirror 15

The MEMS mirror 15 performs scanning using the measurement light outputfrom the cylindrical lens 14 of the light projector 10 a in a seconddirection crossing the first direction. The second direction is shown inFIG. 3 and other drawings. Although the second direction perpendicularlycrosses the first direction in this embodiment, the directionalrelationship is not limited thereto, and the crossing angle between thefirst direction and the second direction is freely set. In the case inFIG. 1, the first direction may be a width direction of the beltconveyor B for conveyance, whereas the second direction may be aconveying direction of the belt conveyor B for conveyance, and viceversa.

The MEMS mirror 15 can use a conventionally known component, andtherefore, it is not described in detail. The MEMS mirror 15 has ascanning mirror that enables scanning in the second direction by usingthe measurement light and has a driving unit that moves this scanningmirror. The MEMS mirror 15 is fixed to the modularizing member 10 b sothat the scanning mirror will face a light emission surface of thecylindrical lens 14. The “MEMS” is an abbreviation of “Micro ElectroMechanical Systems” and is a generally called “micro electro mechanicalsystem”. Using the micro electro mechanical system enables rapidlychanging an angle of the scanning mirror, that is, a reflection angle oran irradiation angle of the measurement light, by a small pitch, as wellas reduction in dimensions. From another point of view, the MEMS mirror15 can also be described as a component in which one mirror is turnablearound one axis. A MEMS mirror having two axes may also be used. In thiscase, the cylindrical lens 14 may not be used. That is, one of the twoaxes may be used to perform laser scanning, whereas the other axis maybe used to expand the laser light or may be imparted with a functionequivalent to the cylindrical lens 14.

The modularizing member 10 b has a light transmitting part to allow themeasurement light to be emitted to the outside after the measurementlight is reflected at the MEMS mirror 15. The light transmitting part ofthe modularizing member 10 b is made to face the measurement lightprojection window 51 a of the housing 5. Thus, the measurement lightthat is reflected at the MEMS mirror 15 is emitted to the measurementobject W after passing through the light transmitting part of themodularizing member 10 b and the measurement light projection window 51a of the housing 5.

As shown in FIG. 7, the MEMS mirror 15 includes a mirror controller 15a. The mirror controller 15 a executes control of movement of the MEMSmirror 15, that is, control of adjustment and change of the angle of thescanning mirror. This control of the MEMS mirror 15 will be specificallydescribed later.

Instead of the MEMS mirror 15, the scanning part can be constituted of agalvanometer mirror, a mirror that is turned by a stepping motor, orother component and can be any device that is able to scan with themeasurement light.

Structure of Displacement Measurement Light Receiver 40

FIG. 3 shows the displacement measurement light receiver 40. Thedisplacement measurement light receiver 40 can be constituted of animage sensor having a two-dimensional light receiving element. Thisimage sensor receives the measurement light that is reflected back fromthe measurement object W and outputs a received-light quantitydistribution for displacement measurement. Furthermore, this imagesensor also receives illumination light that is reflected back from themeasurement object W and outputs a received-light quantity distributionfor luminance measurement. The illumination light is emitted from theilluminator 30. This embodiment uses the condensing optical system 41,and thus, the measurement light and the illumination light reach thelight receiving element of the displacement measurement light receiver40 through the condensing optical system 41. Although the lightreceiving element of the displacement measurement light receiver 40 isnot limited to a specific component, the light receiving element may bea component that converts into an electric signal the intensity of lightthat is obtained through the condensing optical system 41. An example ofthe light receiving element includes a charge-coupled device (CCD) imagesensor and a complementary metal oxide semiconductor (CMOS) imagesensor. The condensing optical system 41 condenses light that entersfrom the outside and typically has one or more optical lenses. Theoptical axis of the condensing optical system 41 and the optical axis ofthe light projector 10 a are made to cross each other.

Although the displacement measurement light receiver 40 is configured tooutput both of the received-light quantity distribution for displacementmeasurement and the received-light quantity distribution for luminancemeasurement in this embodiment, the structure is not limited thereto.For example, as shown in FIG. 8A, a displacement measurement lightreceiver 40A and a luminance measurement light receiver 40B may bedisposed in the housing 50, and a half mirror M may also be disposed inthe housing 50. In this example, two rays of light, which aremeasurement light and illumination light, enter the housing 50 and aresplit by the half mirror M, thereby entering the displacementmeasurement light receiver 40A and the luminance measurement lightreceiver 40B, respectively.

In another example, as shown in FIG. 8B, a displacement measurementlight receiver 40A and a luminance measurement light receiver 40B may bedisposed in the housing 50 so as to have respective light incidentdirections that face the measurement object W. In this case, themeasurement light and the illumination light that are reflected backfrom the measurement object W enter the displacement measurement lightreceiver 40A and the luminance measurement light receiver 40B,respectively.

As shown in FIG. 7, the displacement measurement light receiver 40includes an imaging controller 40 a. The imaging controller 40 aexecutes control of light reception that is implemented by thedisplacement measurement light receiver 40. This control performed bythe imaging controller 40 a will be specifically described later.

Structure of Illuminator 30

The illuminator 30 has multiple light emitting diodes that are disposedseparately from each other in the first direction and the seconddirection, and the illuminator 30 emits light to the measurement objectW from different directions. Specifically, as shown in FIGS. 3 and 5,the illuminator 30 includes a first light emitting diode 31, a secondlight emitting diode 32, a third light emitting diode 33, a fourth lightemitting diode 34, and a plate-shaped mounting member 30 a to whichthese light emitting diodes 31 to 34 are mounted. The mounting member 30a is disposed along the end wall 51 of the housing 50 so as to face thelight reception window 51 b. The mounting member 30 a has a through hole30 b that is formed at a center. The through hole 30 b penetratesthrough the mounting member 30 a in the up-down direction. The incidentside of the condensing optical system 41 is disposed so as to correspondto the through hole 30 b, whereby the measurement light and theillumination light that are reflected back from the measurement object Wenter the condensing optical system 41 by passing through the throughhole 30 b of the mounting member 30 a.

The first to the fourth light emitting diodes 31 to 34 are arranged tosurround the through hole 30 b of the mounting member 30 a and aredirected to emit light downwardly. Thus, the light irradiationdirections of the first to the fourth light emitting diodes 31 to 34 andthe optical axis of the measurement light cross each other.

The first light emitting diode 31 and the second light emitting diode 32are separated from each other in the first direction, whereas the firstlight emitting diode 31 and the third light emitting diode 33 areseparated from each other in the second direction. The second lightemitting diode 32 and the fourth light emitting diode 34 are separatedfrom each other in the second direction, whereas the third lightemitting diode 33 and the fourth light emitting diode 34 are separatedfrom each other in the first direction. This arrangement enablesemitting the illumination light to the measurement object W from fourdirections around the optical axis of the condensing optical system 41.

As shown in FIG. 7, the illuminator 30 includes an illuminationcontroller 35. The illumination controller 35 executes control oflighting and extinction of each of the first to the fourth lightemitting diodes 31 to 34 and executes brightness adjustment of each ofthe first to the fourth light emitting diodes 31 to 34. This control ofeach of the first to the fourth light emitting diodes 31 to 34 will bespecifically described later.

Although the illuminator 30 is provided to the sensor head 2 and isintegrated with the displacement measurement light receiver 40 in thisembodiment, the structure is not limited thereto, and the illuminator 30may be provided separately from the sensor head 2.

The number of the light emitting diodes is not limited to four and canbe any number.

Structure of Angle Measuring Sensor 22

FIG. 5 shows the angle measuring sensor 22 that measures a scanningangle of the measurement light of the MEMS mirror 15 at the time themeasurement light is emitted to a region containing a measurementposition of the measurement object W. The angle measuring sensor 22 isprovided at a position that allows it to receive a ray at an end part inthe first direction of the measurement light, which is moved by thescanning mirror of the MEMS mirror 15. The angle measuring sensor 22 hasa one-dimensional light receiving element 22 a with multiple pixels thatare arrayed in the second direction and also has an angle measuring unit22 b that performs arithmetic processing. The ray at the end part in thefirst direction of the measurement light that enters the light receivingelement 22 a is received by any of the multiple pixels arrayed in thesecond direction and by a pixel in proximity to that pixel, therebygenerating a clear difference in quantity of the received light betweenthe pixels. A relationship between the pixel that receives light of ahighest quantity among the multiple pixels arrayed in the seconddirection and an irradiation angle of the measurement light from thescanning mirror may be obtained in advance. In this condition, the anglemeasuring unit 22 b can measure the irradiation angle of the measurementlight from the scanning mirror on the basis of the received-lightquantity distribution output from the light receiving element 22 a.Obtaining the irradiation angle of the measurement light from thescanning mirror is equivalent to measuring an irradiation angle of thescanning mirror, and from this point of view, the angle measuring unit22 b also serves for measuring the irradiation angle of the scanningmirror. The light receiving element 22 a may be a one-dimensional CMOSsensor or a one-dimensional position sensitive detector (PSD).

The structure of the angle measuring sensor 22 is not limited to thestructure described above. In one example, in a condition in which alight source for emitting reference light for measuring an angle isprovided separately from the light source for the measurement light, thereference light may be emitted to the scanning mirror, and the referencelight reflected at the scanning mirror may be made to enter a positionsensitive detector or other unit, whereby angle information may beobtained on the basis of the output from the position sensitivedetector. In another example, the angle measuring sensor may beincorporated in the MEMS mirror 15. In this case, an example of theangle measuring sensor includes a counter electromotive force sensor anda piezoelectric signal sensor. Although the MEMS mirror 15 is used asthe scanning part in this embodiment, a galvanometer mirror may be usedas the scanning part. In this case, the angle measuring sensor 22 canuse a sensor that receives feedback of an angle at a real time from thegalvanometer mirror.

Structure of Setting Information Storage 23

As shown in FIG. 7, the sensor head 2 is provided with a settinginformation storage 23 that is constituted of each type of a memory andother component. The setting information storage 23 stores variouspieces of setting information sent from the slave amplifier 3 and themaster amplifier 4. Specific contents to be stored in the settinginformation storage 23 will be described later. The setting informationstorage 23 may be equipped to the slave amplifier 3 or the masteramplifier 4 or may be equipped to both of the sensor head 2 and theslave amplifier 3.

Explanation of Measurement Principle

A principle of measuring a displacement at a predetermined position ofthe measurement object W on the basis of various pieces of informationobtained by the sensor head 2 is described herein. Basically, aprinciple of triangulation is used, and this principle is schematicallyshown in FIGS. 9A and 9B. FIG. 9A shows a method used in thisembodiment, and FIG. 9B shows a method as a modification example. Eitherof the methods can be used. As shown in FIGS. 9A and 9B, measurementlight that is emitted from the light projector 10 a is reflected to thesecond direction by movement of the MEMS mirror 15 and irradiates themeasurement object W. The reference symbol W1 denotes a relatively highsurface of the measurement object W, and the reference symbol W2 denotesa relatively low surface of the measurement object W. The followingdescribes details of the measurement principle in FIG. 9A and themeasurement principle of the modification example in FIG. 9B.

In the case in FIG. 9A, the height of the measurement object W isdenoted by Z, and a light projection axis angle is denoted by θ2. Thelight projection axis angle θ2 is measurable by the angle measuringsensor 22. In accordance with the principle of triangulation, in thecondition in which a position y in the second direction of thedisplacement measurement light receiver 40 and the light projection axisangle θ2 are determined, the value Z is uniquely determined. Theposition y in the second direction has a Y coordinate in a Y direction.In view of this, each of the values y, θ2, and Z is measured byexperiments of various patterns, and a data set of the combination (y,θ2, Z) is preliminarily stored in the displacement measuring apparatus 1as a table. During operation of the displacement measuring apparatus 1,the value Z is obtained by referring to the table on the basis of thevalues y and θ2 that are measured. A value that is not contained in thetable is obtained by interpolation processing. Instead of preliminarilystoring the table in the displacement measuring apparatus 1, anapproximation expression for obtaining the value Z on the basis of thevalues (y, θ2) may be prepared and be used to calculate the value Zduring operation of the displacement measuring apparatus 1.

Although the height Z is calculated on the basis of the measurementposition in the second direction at the Y coordinate in the Y directionand the light projection axis angle θ2 in the case in FIG. 9A, thepresent invention is not limited to this method. Alternatively, theheight Z may be calculated on the basis of a measurement position in thefirst direction and the second direction at an X coordinate and a Ycoordinate and the light projection axis angle θ2. The first directionis a depth direction of the paper surface showing FIG. 9A. Essentially,it is desirable that measurement light of laser light extending straightin the first direction is completely parallel to the arrayed directionof the light receiving element 22 a of the displacement measurementlight receiver 40 in the depth direction of the paper surface showingFIG. 9A. However, they may not be parallel to each other due toassembling misalignment in manufacturing, in some cases. Moreover, theremay be cases in which the laser light itself may be curved along thefirst direction due to optical variations. In such cases, it isdifficult to accurately measure a displacement by determining themeasurement position using only the Y coordinate in the seconddirection. In consideration of this, the measurement position in thefirst direction at an X coordinate in the X direction is also used tocalculate the height Z. That is, each of the values x, y, θ2, and Z ismeasured by experiments of various patterns, and a data set of thecombination (x, y, θ2, Z) is preliminarily stored in the displacementmeasuring apparatus 1 as a table. Under these conditions, the height Zmay be calculated on the basis of the three parameters (x, y, θ2) duringoperation. This enables highly accurate displacement measurement. Asdescribed above, instead of storing a table, an approximation expressionmay be used to calculate the value Z in operation. The data set of thecombination (x, y, θ2, Z) corresponds to generally called “calibrationdata” and may be stored at the time of shipment of products, in advance.Specifically, a value θ2 at (x, y) is calculated with respect to eachheight Z of a workpiece for calibration, thereby obtaining calibrationdata in a form in which the height Z is plotted in a three-dimensionalspace coordinates having three axes of an x axis, a y axis, and a θ2axis. During operation, calculated values (x, y, θ2) uniquely determineone point in the three-dimensional space coordinates, and resultantly aheight Z corresponding to the one point is determined.

Next, the modification example in FIG. 9B is described. In the case inFIG. 9B, the height of the measurement object W is denoted by Z, adistance between a light projection position and a light receptionposition is denoted by A (refer to a double-headed arrow in thedrawing), a light reception axis angle is denoted by θ1, and a lightprojection axis angle is denoted by θ2. The light reception axis angleθ1 is measured by using the position of receiving the measurement lightof the displacement measurement light receiver 40. The light projectionaxis angle θ2 is measured by the angle measuring sensor 22. The value Ais preliminarily known and is stored in the displacement measuringapparatus 1. The value Z is calculated from a specific calculationformula by using the values A, 01, and θ2. An example of the specificcalculation formula is described below. First, it is assumed that, in atwo-dimensional coordinate plane having a +X direction in a rightdirection in FIG. 9B and having a +Y direction in an upper direction inFIG. 9B, an origin of this coordinate plane is set at a turning axis ofthe MEMS mirror 15. A straight line of a light projection axis at anangle θ2 in FIG. 9B is expressed by a linear equation: y=tan θ2(gradient of straight line)×x. A straight line of a light reception axisat an angle θ1 in FIG. 9B is expressed by a linear equation: y=tan θ1(gradient of straight line)×x+A tan θ1 (intercept). The value Zcorresponds to a y coordinate of an intersection point of both thestraight lines. Thus, the y coordinate is calculated by solving thesimultaneous linear equations, and as a result, the y coordinate isexpressed by −{A tan θ1 tan θ2/(tan θ2−tan θ1)}. That is, the distancefrom the position of the turning axis of the MEMS mirror 15 to theposition denoted by the reference symbol W2 is an absolute value of thisy coordinate. The known distance from the turning axis of the MEMSmirror 15 to the housing 50 is subtracted from the absolute value of they coordinate, whereby the value Z is obtained. The value Z can becalculated by the calculation formulas as described above.Alternatively, each of the values Z, θ1, and θ2 may be measured byexperiments of various patterns, the results may be stored in thedisplacement measuring apparatus 1 as a table, and the value Z may beobtained by referring to the table on the basis of measured values θ1and θ2 during operation of the displacement measuring apparatus 1. Avalue that is not contained in the table is obtained by interpolationprocessing. The value Z may be calculated each time without using thetable. The light reception axis angle θ1 shown in FIG. 9B and a peakposition in the second direction of the received-light quantitydistribution have a one-to-one correspondence relationship.

Structure of Amplifier

FIG. 7 shows a structure of the slave amplifier 3. Although thefollowing describes the slave amplifier 3 that executes each function,all of these functions may be equipped to the slave amplifier 3, or apart or all of these functions may be equipped to the master amplifier4. In one example, a part or all of the functions of the slave amplifier3 may be equipped to the sensor head 2. In another example, a part orall of the functions of the slave amplifier 3 may be equipped to themonitor device 5A or the personal computer 5B.

The slave amplifier 3 includes a sensor head communicator 300, a triggercontroller 301, and a storage 320. The sensor head communicator 300communicates with the sensor head 2 and makes transmission and receptionof signals between the slave amplifier 3 and the sensor head 2. Thetrigger controller 301 transmits a trigger signal to the sensor head 2.Upon receiving a measurement start trigger signal that defines ameasurement start timing, from the external device 6 via the connectionline 6 a, the trigger controller 301 generates and transmits a triggersignal. The trigger signal may be a periodic trigger signal.

Structure of Luminance Image Generator 302

In the example shown in FIG. 7, the slave amplifier 3 also includes aluminance image generator 302. The luminance image generator 302acquires a received-light quantity distribution for luminancemeasurement and generates a luminance image of the measurement object Wbased thereon. The received-light quantity distribution for luminancemeasurement is output from the displacement measurement light receiver40 when the displacement measurement light receiver 40 of the sensorhead 2 receives the illumination light that is reflected back from themeasurement object W. In the examples shown in FIGS. 8A and 8B, theluminance image generator 302 generates a luminance image of themeasurement object W on the basis of the received-light quantitydistribution for luminance measurement, which is output from theluminance measurement light receiver 40B. The generated luminance imagemay be darker as a luminance value output from the displacementmeasurement light receiver 40 is lower and may be lighter as theluminance value is higher. The generated luminance image may be ablack-and-white image or a color image. The method of generating theluminance image can be any method. For example, the received-lightquantity distribution for luminance measurement may be used as it is, asa luminance image. Alternatively, the received-light quantitydistribution for luminance measurement may be subjected to preprocessingin the sensor head 2, such as FPN correction or HDR correction, or topreprocessing in the slave amplifier 3, such as composition processingfor removing halation.

The luminance image that is generated by the luminance image generator302 is displayed on the display 8 in a condition of being incorporatedin the user interface 70, as shown in FIG. 10. The user interface 70 isgenerated by a UI generator 303 of the slave amplifier 3, which is shownin FIG. 7. The user interface 70 is provided with an image displayregion 71, and the luminance image is displayed in this image displayregion 71. The luminance image that is displayed in the image displayregion 71 is a photographed image of the current measurement object Wand is a generally called “live-view image”. Thus, the display 8displays a luminance image that is generated by the luminance imagegenerator 302.

The display 8 displays a luminance image so that an X coordinate in theluminance image will be a coordinate in a first direction whereas a Ycoordinate in the luminance image will be a coordinate in a seconddirection. The luminance image in a condition of being displayed on thedisplay 8 has an X direction in a lateral direction and has a Ydirection in a longitudinal direction.

The UI generator 303 also generates various user interfaces, asdescribed later, in addition to the user interface 70 shown in FIG. 10.Although the UI generator 303 is provided to the slave amplifier 3 inthis embodiment, the UI generator 303 may be provided to the monitordevice 5A side or the personal computer 5B side.

Structure of Setting Unit 304

As shown in FIG. 7, the slave amplifier 3 also includes the setting unit304. The setting unit 304 receives setting of a measurement position atwhich a displacement is to be measured. The measurement position is setin the luminance image displayed on the display 8. When a user touches apart, at which a displacement is to be measured, of a measurement objectW in the luminance image displayed on the display 8, the setting unit304 identifies the touched position in terms of, for example, XYcoordinates, and sets the identified position as a measurement position.That is, the setting unit 304 detects an operation of input of themeasurement position and identifies the measurement position. Thisresults in reception of the measurement position set by a user. Afterthe measurement position is set, a mark 72 showing the measurementposition is displayed in a manner superimposed on the luminance image inthe image display region 71 of the user interface 70, as shown in FIG.11. The mark 72 can also be called a “measurement point”. It is possibleto move the mark 72 to another part by a drag operation, for example.

Multiple different measurement positions may be set in one luminanceimage. In this case, the multiple measurement positions may be separatedfrom each other in the first direction or may be separated from eachother in the second direction. Multiple positions that differ from eachother in the second direction may be set as a first measurement positionand a second measurement position, respectively.

The setting of the measurement position may be accepted only when themeasurement position is in a scannable range, which is scanned with themeasurement light by the MEMS mirror 15. The scannable range, which isscanned with the measurement light by the MEMS mirror 15, may be storedin advance. It is difficult to measure a displacement at a measurementposition set outside the scannable range of the measurement light. Thus,it is configured to inhibit setting a measurement position outside thescannable range of the measurement light. When a measurement position isdesignated outside the scannable range of the measurement light, thisoperation may not be accepted, or designating a measurement positionoutside the scannable range of the measurement light may be informed toa user.

The setting unit 304 sets a displacement measurement range in which adisplacement at the measurement position is measured. As shown in FIG.12, an application range setting region 73 may be displayed on a side ofthe image display region 71 of the user interface 70 to enable settingthe displacement measurement range with use of the application rangesetting region 73. The degree of the range for the displacementmeasurement range may be set in terms of numerical value (mm). Thenumerical value is plus in a higher direction and is minus in a lowerdirection relative to a displacement at the measurement position markedwith the mark 72. When a measurement range is narrow, the scanning rangeof the measurement light is also narrow. Thus, the measurement isperformed at a higher speed as the measurement range is narrower. Thismeasurement range may be represented by a Z coordinate.

The setting unit 304 receives setting of a region for correcting theposition to be measured, which is set in the luminance image, when thedisplacement measuring apparatus 1 is set. To shorten a time formeasurement performed by the displacement measuring apparatus 1, thescanning range of the measurement light should be narrowed. On the otherhand, in an actual site for measuring a measurement object W, theposition and the posture of the measurement object W may not be constantand may be changed. Thus, when the position or the posture of themeasurement object W is changed in the condition in which the scanningrange of the measurement light is set narrow, the measurement object Wmay not come into the preset scanning range, resulting in failure in themeasurement or incorrect measurement due to low accuracy.

In this embodiment, when a user sets a region 74 for position correctionby operating the input unit 9 shown in FIG. 7 in the state in which aluminance image is displayed in the image display region 71 of the userinterface 70, as shown in FIG. 11, this setting is received by thesetting unit 304. The region 74 for position correction is set by meansof a method such as enclosing the region with a frame line as shown inFIG. 13, coloring the region, or painting the region. The shape of theframe line may be rectangular or circular. In the case of enclosing aregion by a rectangular frame line, a tool, such as a stylus, may bemoved from an upper corner to a lower corner or from a lower corner toan upper corner of a region to be enclosed.

The region 74 for position correction is basically used for correctingthe position. In addition to the region 74 for position correction, aregion to be measured by each type of a measurement tool, that is, ameasurement tool region is also set. One or multiple measurement toolregions are set in connection with relative positional relationshipsrelative to the region for position correction. During operation, afterthe position and the posture of a workpiece are determined by using theregion 74 for position correction, the relative positional relationshipis used to also correct the position and the posture of the measurementtool region. Although the region 74 for position correction and themeasurement tool region are set individually herein, the region 74 forposition correction may be used also as the measurement tool region, forexample.

The setting unit 304 may receive designation of a region covering ameasurement position and the vicinity of the measurement position.Instead of designation of a point for a measurement position,designation of a region covering a measurement position and the vicinityof the measurement position may be received to make the region have anarea to some extent.

The above describes the setting method in the scanning mode for scanningwith the measurement light. In a line mode in which scanning using themeasurement light is not performed, as shown in FIG. 14, the region 74for position correction is set by designating a part of a line ofmeasurement light extending in the X direction. The display 8 displays ameasurement light position indicating line 76 in a manner superimposedon a luminance image of the measurement object W. The measurement lightposition indicating line 76 indicates a position of the measurementlight that irradiates the measurement object W. Under these conditions,when a user designates two or more positions on the measurement lightposition indicating line 76, the part between the designated twopositions is set as the region 74 for position correction. Also in thecase of the line mode, a region covering a measurement position and thevicinity of the measurement position may be received. The measurementlight position indicating line 76, which indicates the position of themeasurement light, can also be called a “virtual measurement emissionline”.

Structure of Edge Extracting Unit 306

As shown in FIG. 7, the slave amplifier 3 also includes an edgeextracting unit 306. The edge extracting unit 306 extracts an edge ofthe measurement object W in the luminance image. The edge is defined asan outline or an external line of the measurement object W in a broadsense. The processing of extracting an edge can be performed by aconventionally known method. For example, a pixel value of each pixel ofa luminance image is obtained, and a boundary part of a region in whicha difference in the pixel value of the luminance image is at or greaterthan a threshold for detecting an edge is extracted as an edge. Thethreshold for extracting an edge is adjusted as desired by a user.

Specifically, as shown in FIG. 13, when the region 74 for positioncorrection is set in the state in which a luminance image is displayedin the image display region 71 of the user interface 70, the edgeextraction processing is executed in the region 74. A part that isestimated as an outline or an external line of the measurement object Wis extracted as an edge. The edge of the measurement object W is shownby an edge indicating line 75. The edge indicating line 75 is, forexample, made of a thick line, a dashed line, a line with a conspicuouscolor, such as red or yellow, but it is not limited thereto. The edgeindicating line 75 may be displayed by blinking or other manner. In thecase in FIG. 13, an edge that is extracted by the edge extracting unit306 is displayed in a manner superimposed on the luminance image. Thesuperimposing display processing of the edge may be performed by theluminance image generator 302 or the UI generator 303.

FIG. 13 shows a situation of extracting an edge in the scanning mode forscanning with the measurement light. A situation of extracting an edgefrom a height profile in the line mode, in which scanning using themeasurement light is not performed, is shown in FIG. 14. Similarly, alsoin the case of the line mode, an edge is extracted from a height profileby the edge extracting unit 306, and an edge indicating line 75 isdisplayed in the manner superimposed on the luminance image. Thus, theedge extracting unit 306 extracts an edge in the luminance image in thescanning mode for scanning with the measurement light and extracts anedge from a height profile in the line mode, in which scanning using themeasurement light is not performed. The present invention is not limitedto these functions, and for example, a function of extracting an edgefrom the measurement light position indicating line 76 in the luminanceimage may also be employed in the line mode.

Structure of Correction Information Storage 320 a

As shown in FIG. 7, the slave amplifier 3 also includes a correctioninformation storage 320 a. The correction information storage 320 astores position correction information in the region 74 that is set bythe setting unit 304, in conjunction with relative position informationbetween the position correction information and the measurement positionset by the setting unit 304. The region 74 is shown in FIG. 11 and otherdrawings. The correction information storage 320 a may be provided as apart of the storage 320 of the slave amplifier 3. The positioncorrection information in the region 74 is necessary for a positioncorrector 307 to correct the position of the measurement object W andmay be used as a reference for correction of the position. The positioncorrector 307 will be described later. An example of information that isable to be used as a reference for correction of the position includes apart of a luminance image generated by the luminance image generator302, luminance information of a luminance image, and edge informationrelating to an edge extracted by the edge extracting unit 306 containinga point cloud of the edge. In the case of using a part of a luminanceimage for the position correction information, this image can also becalled a “template image”.

Apart of a luminance image may be an image showing a part of themeasurement object W, among luminance images generated by the luminanceimage generator 302. The part of the luminance image is preferably animage containing a region or a position that enables determining theposition and the posture of the measurement object W. The luminanceinformation of a luminance image may use a luminance value of eachpixel. Also in this case, the luminance information preferably uses apixel value of a region or a position that enables determining theposition and the posture of the measurement object W. The edgeinformation relating to an edge extracted by the edge extracting unit306 may use data such as a shape or length of an edge line, the numberof edge lines, or relative position coordinates of multiple edge lines.Also in this case, edge information that enables determining theposition and the posture of the measurement object W is preferable.

The position correction information and the shape or the dimensions ofthe region 74 are mutually associated and are stored in the correctioninformation storage 320 a, and coordinate information showing a relativepositional relationship between the position correction information anda measurement position is also stored in the correction informationstorage 320 a. This storing may be performed at the completion ofextraction of an edge or at the completion of setting of one program, asdescribed later. The correction information storage 320 a may store atemplate image and edge information in association with each other ormay store edge information without storing a template image.

Structure of Position Corrector 307

As shown in FIG. 7, the slave amplifier 3 also includes the positioncorrector 307. During operation of the displacement measuring apparatus1 in the scanning mode, the position corrector 307 determines theposition and the posture of the measurement object W in a luminanceimage that is newly generated by the luminance image generator 302, byusing the position correction information stored in the correctioninformation storage 320 a, to correct the measurement position using therelative position information.

For example, in the case in which a template image is stored as theposition correction information, whether the template image is containedin a newly generated luminance image is determined by means of anormalized correlation. When it is determined that the template image iscontained, the newly generated luminance image is moved and rotated oris subjected to other processing so as to coincide with the position andthe posture of the template image that are specified in advance, wherebythe position and the posture of the luminance image are corrected. Atthe same time, the measurement position in the newly generated luminanceimage is corrected on the basis of relative position information betweenthe template image and the measurement position.

In the case in which edge information is stored as the positioncorrection information, whether a corresponding edge is contained in anewly generated luminance image is determined. When it is determinedthat the corresponding edge is contained, the newly generated luminanceimage is moved and rotated or is subjected to other processing so as tocoincide with the position and the posture of the luminance image thatare specified in advance, whereby the position and the posture of theluminance image are corrected. At the same time, the measurementposition in the newly generated luminance image is corrected on thebasis of relative position information between the edge information andthe measurement position.

With this structure, measurement is performed in the state in which theposition and the posture are corrected to predetermined conditions, whenthe position or the posture of a measurement object W is changed in anactual site for measuring the measurement object W. There are somemethods for the correction. For example, the position and the posture ofa luminance image may be corrected by moving or rotating the luminanceimage, as described above. Alternatively or additionally, a measurementtool region may be moved or rotated to correct the position. Duringoperation of the displacement measuring apparatus 1 in the line mode,the position may be corrected on the basis of relative positioninformation between the measurement position and information of an edgethat is extracted from the height profile as described above.

Structure of Measurement Tool Selector 308

As shown in FIG. 7, the slave amplifier 3 also includes a measurementtool selector 308. The measurement tool selector 308 enables selectingone or multiple measurement tools from among multiple measurement tools.The measurement tool selector 308 makes the UI generator 303 generate ameasurement tool selection interface 80 as shown in FIG. 15 and makesthe generated measurement tool selection interface 80 display on thedisplay 8. Examples of the measurement tools include a height differencetool for measuring a dimension of a height difference of a measurementobject W, a height tool for measuring a height at a predeterminedposition of a measurement object W, a designated-height area tooldescribed below, a position correction tool for correcting the positionof a measurement object W, and a maximum and minimum height tool formeasuring the maximum height and the minimum height in a predeterminedrange of a measurement object W. However, a measurement tool other thanthese measurement tools may also be provided.

When a measurement tool displayed as an icon in the measurement toolselection interface 80 is selected by operation by a user, the selectedmeasurement tool is stored in the storage 320. Although it is notnecessary to designate an application order of the measurement toolsduring operation of the displacement measuring apparatus 1, theapplication order may be designated and be also stored in the storage320.

The measurement tool also includes multiple measurement tools in whichthe dimensions of displacement measurement regions differ from eachother. For example, as shown in FIG. 16, a size selector 81 may beprovided on a side of the image display region 71 as the measurementtool selector 308 for selecting a size of the displacement measurementregion. Upon operation of the size selector 81, selection of a desiredmeasurement tool from among the multiple measurement tools, in which thedimensions of the displacement measurement regions differ from eachother, is received. In this case, the “Point” corresponds to the mark 72indicating the measurement position. When “Normal” is selected, a circlewith a size shown by a solid line in FIG. 16 is displayed, and the innerpart of this circle serves as the displacement measurement region. Onthe other hand, when “Large” is selected, a circle with a size shown bythe virtual line in FIG. 16 is displayed, and the inner part of thiscircle serves as the displacement measurement region. Although not shownin the drawing, a circle that is smaller than the “Normal” circle isdisplayed, and the inner part of this circle serves as the displacementmeasurement region, when “Small” is selected. The region may be enclosedby a mark with a shape other than circle, and the dimensions of themeasurement region may be varied continuously.

Structure of Measurement Controller 305

A measurement controller 305 controls the light projector 10 a and theMEMS mirror 15 to cause the measurement light to be emitted to ameasurement position and a displacement measurement range that are setby the setting unit 304. The measurement controller 305 may beconfigured to control the light projector 10 a and the MEMS mirror 15 tocause the measurement light to be emitted only to a region received bythe setting unit 304. The measurement controller 305 may change ascanning range of the measurement light of the MEMS mirror 15 on thebasis of the Y coordinate of the measurement position in the luminanceimage. Specifically, on the basis of the Y coordinate of the measurementposition and the displacement measurement range in which a displacementis measured, the range to be scanned by the MEMS mirror 15 is setnarrower than the range that is scannable by the MEMS mirror 15.

This function is described in detail by using FIGS. 17 and 18. FIGS. 17Ato 17D show a situation in which measurement is performed by arrangingthe sensor head 2 above a measurement object W, as viewed from a side.The range B that is indicated by the oblique lines is a range of avisual field of a luminance image and also a range in which height ismeasurable by the displacement measuring apparatus 1. The range B isable to be irradiated with the measurement light, and thus, the range Bcan also be understood as a scannable range that is able to be scannedby the MEMS mirror 15. FIGS. 17A and 17B show a case of disposing themeasurement object W at a first position that is at the center in a Ydirection. FIGS. 17C and 17D show a case of disposing the measurementobject W at a second position that is separated from the first positiontoward the minus side in the Y direction.

The reference symbol D in FIG. 17A denotes a measurement position thatis set by the setting unit 304 and that is obtained from a Y coordinate.The lines E and F represent an irradiation range of the measurementlight. The measurement controller 305 controls the MEMS mirror 15 tocause the measurement light to irradiate the measurement position D setby the setting unit 304. As a result, a measurement time is made shorterthan that in the case of scanning the whole range B, in which the heightis measurable, by using the measurement light.

In a case in which the height of the disposed measurement object W isunknown, it is necessary to scan the range B, in which the height ismeasurable, in the whole Z direction, as indicated by the line Gextending in the up-down direction. In this case, a range OA between thelines E and F in FIG. 17A is scanned by the measurement light. Even inthe case of scanning the range OA by the measurement light, themeasurement time is shorter than that in the case of scanning the wholerange B, in which the height is measurable, by using the measurementlight. However, this embodiment enables further high-speed measurementby specifying the measurement range in the Z direction of themeasurement object W. The measurement range in the Z direction of themeasurement object W may be set by the setting unit 304, as describedabove, and an upper end and a lower end of the measurement range arerepresented by Z coordinates, respectively. The measurement range in theZ direction of the measurement object W may be a range in which themeasurement object W exists or may be a variation range of themeasurement position. Specifying the measurement range in the Zdirection of the measurement object W makes, as shown in FIG. 17B, theangle between the lines E and F smaller than that in the case shown inFIG. 17A. The small angle between the lines E and F represents a narrowscanning range of the measurement light, thereby enabling increase inthe speed of the measurement.

FIG. 17C shows a case in which a measurement object W is at a secondposition. Also in this case, it is possible to narrow the irradiationrange of the measurement light on the basis of the measurement positionset by the setting unit 304, thereby making the measurement time shorterthan that in the case of scanning the whole range B, in which the heightis measurable, by using the measurement light. As shown in FIG. 17D,specifying the measurement range in the Z direction of the measurementobject W makes the angle between the lines E and F smaller than that inthe case shown in FIG. 17C, thereby narrowing the scanning range of themeasurement light and enabling further increase in the speed of themeasurement.

FIG. 18A shows a situation in which scanning is performed with themeasurement light in the condition in FIG. 17B, as viewed from above.The extending direction of the measurement light is an X direction inthe right-left direction in the drawing. The scanning direction of themeasurement light is a Y direction in the up-down direction in thedrawing. The measurement position that is set by the setting unit 304 isindicated by a circle of a mark 72. The measurement light is emittedbetween the lines E and F at intervals in the Y direction multiple timesso as to irradiate the inner part of the circle of the mark 72, as shownby the solid lines. This scanning process is a first scanning process inwhich the measurement object W is scanned at a relatively large pitch bythe measurement light. During the first scanning process, the angle ofscanning performed by the MEMS mirror 15 at the time the measurementlight is emitted to a region containing the measurement position ismeasured by the angle measuring unit 22 b.

Thereafter, the measurement controller 305 performs a second scanningprocess in which scanning is performed at a relatively small pitch at anirradiation angle around the scanning angle measured by the anglemeasuring unit 22 b. The measurement light that is emitted in the secondscanning process is shown by the dashed lines in FIG. 18A. The intervalsin the Y direction of the measurement light are shorter than those inthe first scanning process, which are shown by the solid lines. Theintervals in the Y direction are set so that at least one, orpreferably, at least two, rays of the measurement light will irradiatethe circle of the mark 72. The first scanning process can be called an“approximate searching processing” for searching for the measurementposition. On the other hand, the second scanning process can be called“precise measurement processing” for precisely measuring the measurementposition that is searched for in the approximate searching.

FIG. 18B shows a situation in which scanning is performed with themeasurement light in the condition in FIG. 17D, as viewed from above.Also in the case in which the measurement object W is at the secondposition, the precise measurement processing is performed after theapproximate searching processing for searching for the measurementposition is performed. In the case in which the measurement object W isat the second position, the scanning range of the measurement light iswider than that in the case in which the measurement object W is at thefirst position, that is, θA<θB, and the number of the rays of themeasurement light in the approximate searching processing is increased.In this example, the number of the rays of the measurement light isincreased from five to seven. That is, the scanning range of themeasurement light is varied in accordance with the Y coordinate. Fromthis point of view, the measurement controller 305 individually sets thescanning ranges of the measurement light with respect to correspondingmeasurement positions set by the setting unit 304.

As shown in FIGS. 17A to 17D, the measurement controller 305 moves thescanning mirror of the MEMS mirror 15 in a first scanning range that isnarrower than the scannable range so that the measurement light willirradiate at least the measurement position set by the setting unit 304.Then, the measurement controller 305 acquires a first irradiation angleof the scanning mirror, which is measured by the angle measuring unit 22b at the time the measurement light is emitted to the measurementposition. These operations are performed in the approximate searchingprocessing. The measurement controller 305 also cause the scanningmirror to move in a second scanning range that covers the firstirradiation angle and that is narrower than the first scanning range.Then, the measurement controller 305 acquires a second irradiation angleof the scanning mirror, which is measured by the angle measuring unit 22b at the time the measurement light is emitted to the measurementposition. These operations are performed in the precise measurementprocessing. The measurement controller 305 causes the measurement lightto irradiate the measurement position in the first scanning range and inthe second scanning range, in this order. The first irradiation angleand the second irradiation angle are stored in the storage 320.

In a case of setting multiple measurement positions, the measurementcontroller 305 causes the measurement light to irradiate each of themeasurement positions in the first scanning range and in the secondscanning range, in this order. In the case of setting a firstmeasurement position and a second measurement position, the measurementcontroller 305 may cause the measurement light to irradiate the firstmeasurement position in the first scanning range and in the secondscanning range, in this order, and then irradiate the second measurementposition in the first scanning range and in the second scanning range,in this order. Alternatively, in the case of setting the firstmeasurement position and the second measurement position, themeasurement controller 305 may cause the measurement light to irradiatethe first measurement position and the second measurement position inthe first scanning range and then irradiate the first measurementposition and the second measurement position in the second scanningrange.

The measurement controller 305 varies the pitch of the measurement lightfor scanning the measurement position, in accordance with the dimensionsof the measurement region of the measurement tool selected by themeasurement tool selector 308. FIGS. 19A and 19B show a situation ofchanging the tool size of the height tool. The mark 72 with a large sizecauses a large pitch of the measurement light, as shown in FIG. 19A,whereas the mark 72 with a small size causes a small pitch of themeasurement light, as shown in FIG. 19B. The pitch of the measurementlight may be set by three or more steps, and the pitch of themeasurement light may be set so that three to five rays of themeasurement light will enter the inner part indicated by the mark 72.That is, the measurement controller 305 moves the scanning mirror tocause the measurement light to irradiate the measurement region of themeasurement tool selected by the measurement tool selector 308.Specifically, the measurement controller 305 moves the scanning mirrorto cause the measurement light to irradiate the measurement region ofthe measurement tool selected by the measurement tool selector 308, atintervals in the Y direction or the second direction multiple times. Thescanning mirror may be moved to make the measurement light irradiate themeasurement region only once.

After the position is corrected, the scanning range and the scanningposition of the measurement light are changed. That is, the measurementcontroller 305 controls the light projector 10 a and the MEMS mirror 15to cause the measurement light to irradiate the position corrected bythe position corrector 307. At this time, the light projector 10 a andthe MEMS mirror 15 may be controlled to cause the measurement light toirradiate only the measurement position corrected by the positioncorrector 307. The measurement controller 305 may change a scanningrange of the measurement light of the MEMS mirror 15 on the basis of theY coordinate of the measurement position corrected by the positioncorrector 307, in the luminance image. Specifically, on the basis of theY coordinate of the measurement position corrected by the positioncorrector 307 and the displacement measurement range in which adisplacement is measured, the range to be scanned by the MEMS mirror 15is set narrower than the range that is scannable by the MEMS mirror 15.

As shown in FIG. 20, a first measurement position, a second measurementposition, and a third measurement position may be set, and each may bescanned with the measurement light. In this case, for example, after thefirst measurement position is scanned, the MEMS mirror 15 is preferablycontrolled to scan the third measurement position at the measurementposition close to the first measurement position in a Y direction,instead of the second measurement position, and then scan the secondmeasurement position. This procedure increases the scanning speed of theMEMS mirror 15 in the case of measuring all of the first measurementposition, the second measurement position, and the third measurementposition.

Structure of Mode Selector 309

As shown in FIG. 7, the slave amplifier 3 also includes a mode selector309. The mode selector 309 enables selecting a mode of operation of thedisplacement measuring apparatus 1 and enables a user to select the linemode or the scanning mode. The line mode makes the measurement light toirradiate the measurement object W while scanning is not performed bythe MEMS mirror 15. The scanning mode makes the MEMS mirror 15 scan themeasurement object W by using the measurement light. In the case inwhich a displacement is measurable in the line mode, the measurement isfinished for a short time due to not scanning with the measurementlight. On the other hand, a wide range may be measured in the scanningmode. For example, a means for selecting between the line mode and thescanning mode may be generated in a form of a mode selection userinterface (not shown) by the UI generator 303. This mode selection userinterface may be displayed on the display 8, and selection may bereceived through operation in this user interface by a user.

In the case in which the scanning mode is selected by the mode selector309, the measurement controller 305 controls the light projector 10 aand the MEMS mirror 15 to cause the measurement light to successivelyirradiate different positions in the Y direction or the second directionof the measurement object W. On the other hand, in the case in which theline mode is selected by the mode selector 309, the measurementcontroller 305 controls the light projector 10 a and the MEMS mirror 15to cause the measurement light to irradiate the same positions in thesecond direction of the measurement object W. Switching of the modes isthus executed.

In the case in which the line mode is selected by the mode selector 309,the measurement controller 305 causes the measurement light to irradiatethe same positions in the second direction of the measurement object Wwithout moving the scanning mirror. Moreover, in the case in which theline mode is selected by the mode selector 309, the measurementcontroller 305 causes the measurement light to irradiate multiplepositions that are adjacent to each other in the second direction, bymoving the scanning mirror.

The result of the selection between the scanning mode and the line modeis stored in a setting information storage 320 f of the storage 320.

Structure of Irradiation Direction Adjuster 310

As shown in FIG. 7, the slave amplifier 3 also includes an irradiationdirection adjuster 310. The irradiation direction adjuster 310 adjuststhe irradiation direction of the measurement light in the seconddirection in the case in which the line mode is selected by the modeselector 309. The adjustment of the irradiation direction is performedon a user interface by a user, for example.

Structure of Irradiation Angle Determining Unit 311

As shown in FIG. 7, the slave amplifier 3 also includes an irradiationangle determining unit 311. The irradiation angle determining unit 311continuously acquires a quantity of light received at a pixel positionof a light receiving element corresponding to the measurement position.This quantity is output from the displacement measurement light receiver40. Moreover, the irradiation angle determining unit 311 determines anirradiation angle of the scanning mirror at the time the measurementlight is emitted to the measurement position. The scanning angle of themeasurement light of the MEMS mirror 15 at the time the measurementlight is emitted to a region containing the measurement position of themeasurement object W is obtained by the angle measuring sensor 22. Theoutput value of this angle from the angle measuring sensor 22 is used tocalculate the irradiation angle of the scanning mirror at the time themeasurement light is emitted to the measurement position. The obtainedirradiation angle of the scanning mirror is determined as an irradiationangle of the scanning mirror at the time the measurement light isemitted to the measurement position. The determined irradiation angle ofthe scanning mirror is stored in the storage 320. In determining theirradiation angle of the measurement light, an approximate irradiationangle may be determined on the basis of a drive signal to the MEMSmirror 15, without using the angle measuring sensor 22. However, inconsideration of variations in temperature characteristics and changeswith time, the angle is preferably measured by the angle measuringsensor 22 or other appropriate unit, in order to know an accurateirradiation angle.

Structure of Displacement Measuring Unit 312

As shown in FIG. 7, the slave amplifier 3 also includes a displacementmeasuring unit 312. The displacement measuring unit 312 employs theprinciple of triangulation as a measurement principle. The displacementmeasuring unit 312 measures a displacement at the measurement positionon the basis of the received-light quantity distribution fordisplacement measurement. The displacement measurement light receiver 40outputs the received-light quantity distribution for displacementmeasurement upon receiving the measurement light that is emitted to andis reflected back from the measurement position set by the setting unit304. The displacement measuring unit 312 may also measure a displacementon the basis of the measurement light that is reflected back from aregion containing the measurement position, instead of the measurementlight reflected back from the measurement position. That is, thedisplacement measuring unit 312 may measure a displacement at ameasurement position on the basis of the received-light quantitydistribution for displacement measurement, which is output from thedisplacement measurement light receiver 40 at the time the measurementlight is emitted to a region containing the measurement position set bythe setting unit 304. The measurement result may be stored in ameasurement data storage 320 e shown in FIG. 7. The functions of thedisplacement measuring unit 312 may be separated to the sensor head 2and the slave amplifier 3.

After the first scanning process for scanning the measurement object Wat a relatively large pitch by using the measurement light is performed,the displacement measuring unit 312 measures a displacement at themeasurement position on the basis of the received-light quantitydistribution that is acquired when the measurement light irradiates aregion containing the measurement position, in the second scanningprocess for scanning at a relatively small pitch by using themeasurement light.

The display 8 shows the displacement at the measurement positionmeasured by the displacement measuring unit 312 by displaying a relativepositional relationship between the measured displacement and a maximumdisplacement measurement range in which the displacement measuring unit312 is able to measure. Specifically, in one example as shown by theuser interface 70 in FIG. 10, after a displacement at the measurementposition indicated by the mark 72 is measured, the measured value isdisplayed in a measured value display region 70 a provided at a lowerpart of the user interface 70. A maximum displacement measurement rangedisplay region 70 b is provided on a side of the measured value displayregion 70 a. The maximum displacement measurement range display region70 b shows that the height at the part indicated by the mark 72 ishigher as the indication approaches a right side and is lower as theindication approaches a left side, thereby enabling visual understandingof the degree of the height at the part indicated by the mark 72 in themaximum displacement measurement range. Thus, the degree of a margin ofthe measurement position indicated by the mark 72 within the maximumdisplacement measurement range is known.

In the case in which the position is corrected, measurement light thatirradiates a measurement position corrected by the position corrector307 is reflected back from this measurement position and is received bythe displacement measurement light receiver 40. Also in the case inwhich the position is corrected, the displacement measuring unit 312measures a displacement of the measurement position on the basis of thereceived-light quantity distribution for displacement measurement, whichis output from the displacement measurement light receiver 40.

The displacement measuring unit 312 acquires the received-light quantitydistribution for displacement measurement output from the displacementmeasurement light receiver 40. In this condition, the displacementmeasuring unit 312 employs the principle of triangulation to measure adisplacement at the measurement position on the basis of the angle ofthe scanning mirror or the second irradiation angle, which is measuredby the angle measuring unit 22 b at the time the measurement light isemitted to the measurement position, as well as the position in the Ydirection or the second direction of the measurement position. Moreover,as described above, a displacement at the measurement position may alsobe measured on the basis of the position in the X direction or the firstdirection as well as the position in the Y direction or the seconddirection. Specifically, this can be implemented by storing calibrationdata at the time of shipment of products. For example, while themeasurement light is emitted, a calibration plate is disposed at afreely selected height Z, and a luminance image is imaged to recognizethe extending direction of the measurement light at that time. If theextending direction is not parallel to a longitudinal direction of thelight receiving element 22 a or is curved, the deviated amount is storedas calibration data. In addition, a luminance image is imaged each timethe calibration plate is disposed at each position with a heightdifferent from the freely selected height Z, to recognize the extendingdirection of the measurement light each time. Thus, calibration data ateach height Z is obtained and is stored. During operation, an accuratedisplacement at the measurement position may be measured by using thecalibration data on the basis of a position represented by an Xcoordinate in the X direction or the first direction of the measurementposition.

The displacement measuring unit 312 acquires the received-light quantitydistribution for displacement measurement, which is output from thedisplacement measurement light receiver 40. This acquisition isperformed while scanning is performed in the first scanning range in theapproximate searching processing, at intervals longer than the intervalsof the acquisition performed while scanning is performed in the secondscanning range that is narrower than the first scanning range. Thereason for this is that the pitch of the measurement light at the timeof scanning in the first scanning range is larger than the pitch of themeasurement light at the time of scanning in the second scanning range.When the pitch is narrow, the irradiation interval of the measurementlight is short, and the interval of acquiring the received-lightquantity distribution is shortened accordingly.

The displacement measuring unit 312 may also measure a displacement atthe measurement position on the basis of the received-light quantitydistribution that is acquired when the measurement light irradiates aregion containing the measurement position, in the second scanningprocess. The displacement measuring unit 312 may measure a displacementat the measurement position multiple times by acquiring thereceived-light quantity distribution for displacement measurement, whichis output from the displacement measurement light receiver 40 each timethe measurement light is emitted, and the displacement measuring unit312 may average the obtained multiple displacements.

The displacement measuring unit 312 may also measure a displacement atthe measurement position on the basis of the irradiation angle that isdetermined by the irradiation angle determining unit 311 as well as apeak position in the received-light quantity distribution acquired whenthe measurement light is emitted to the measurement position. FIG. 21Ashows a distribution of light quantity that is output from thedisplacement measurement light receiver 40 when the measurement lightextending in an X direction is emitted to a measurement object W. Thecenter part is higher than each side part because the height of thecenter part is high. The range between the two dashed lines is extractedfrom FIG. 21A, and an enlarged range is shown in FIG. 21B. As shown inFIG. 21B, a peak position is obtained on the basis of the received-lightquantity distribution. Details of the process for obtaining the peakposition will be described later.

The displacement measuring unit 312 may estimate a peak position on thebasis of the received-light quantity distribution acquired when themeasurement light irradiates a measurement position. More specifically,in a case in which the received-light quantity distribution is notcontinuously obtained in the Y direction, a peak position is estimatedon the basis of the received-light quantity distribution obtained fromthe surroundings of the measurement position.

The displacement measuring unit 312 may determine a peak position byselecting one from among multiple peaks in a case in which the multiplepeaks exist in the received-light quantity distribution acquired whenthe measurement light irradiates a measurement position. A highest peakamong multiple peak positions that exist at intervals in the Y directionmay be used as a peak position. Of course, instead of using the highestpeak as the peak position, an optimal peak position may be estimated onthe basis of the multiple peak positions.

The displacement measuring apparatus 1 may be set to make themeasurement controller 305 control the light projector 10 a and the MEMSmirror 15 so that the measurement light will scan the whole measurementobject W at a first pitch and then scan the whole measurement object Wat a second pitch different from the first pitch. In this case, thedisplacement measuring unit 312 generates first height data of the wholemeasurement object W on the basis of the received-light quantitydistribution for displacement measurement that is sequentially outputfrom the displacement measurement light receiver 40 in scanning at thefirst pitch. Moreover, the displacement measuring unit 312 generatessecond height data of the whole measurement object W on the basis of thereceived-light quantity distribution for displacement measurement thatis sequentially output from the displacement measurement light receiver40 in scanning at the second pitch.

The first height data and the second height data are master data andconstitute three-dimensional data that is stored in conjunction withluminance images. Holding the first height data and the second heightdata enables obtaining a displacement from the first height data or thesecond height data without emitting the measurement light to ameasurement position and immediately displaying the displacement, inmeasuring using the measurement tool at the time of setting. In a casein which the position of the measurement tool is finely adjusted afterthe setting is once performed, a displacement at the measurementposition after this adjustment is retrieved without preparing ameasurement object W as a master again.

Although the height data may be one piece of information, the firstheight data and the second height data in which the pitch of themeasurement light differ from each other may be held. In this case, adisplacement is read from the corresponding height data with respect toeach measurement tool and each size of the measurement tool, and theread data is displayed. For example, one master data that is obtained bymeasurement at a small pitch may be held and be used by reducing datacontained in the master data. However, the master data that is generatedby reducing data therein may not completely correspond to a finalprocess, and therefore, it is preferable to hold multiple pieces ofheight data in which pitches of the measurement light differ from eachother. The height data is stored in a height data storage 320 b of thestorage 320.

In the case in which the line mode is selected by the mode selector 309,the displacement measuring unit 312 may measure a displacement of themeasurement object W multiple times by acquiring the received-lightquantity distribution for displacement measurement, which is output fromthe displacement measurement light receiver 40 each time the measurementlight is emitted. Moreover, the displacement measuring unit 312 mayaverage the obtained multiple displacements. The word “average”, whichis described in this specification, refers to a broad concept includinguse of, for example, trimmed mean, a median filter, and various kinds offilters, in addition to mean in a narrow sense.

Structure of Pass/Fail Determining Unit 313

As shown in FIG. 7, the slave amplifier 3 also includes a pass/faildetermining unit 313. The pass/fail determining unit 313 determinespass/fail of the measurement object W by combining a result ofdetermining the condition of the measurement object W on the basis of aluminance image, which is generated by the luminance image generator302, and a result of determining the condition of the measurement objectW on the basis of the displacement, which is measured by thedisplacement measuring unit 312. For example, whether a part is missedis detected in a luminance image, and the measurement object W isdetermined as being a defective product in a case in which thedisplacement measured by the displacement measuring unit 312 does notsatisfy a reference value even though no part is missed. In contrast,the measurement object W may be determined as being a defective productin a case in which missing of a part is determined in a luminance imageeven though the displacement measured by the displacement measuring unit312 satisfies the reference value. These process results may be storedin a process result storage 320 c shown in FIG. 7.

Structure of Setting Information Storage 320 f

The setting information storage 320 f stores programs as shown in FIGS.22 to 24. The program is composed of multiple pieces of settinginformation, and multiple programs may be stored. The settinginformation that is contained in each of the programs includesinformation such as a result of selection between the scanning mode andthe line mode, setting relating to a trigger, setting relating toimaging such as brightness and sensitivity, existence of master data,correction of tilt of a head, a measurement tool to be applied, andparameters for the measurement tool. A user is allowed to select adesired program from among the programs stored in the settinginformation storage 320 f and to use the selected program in operatingthe displacement measuring apparatus 1.

Specific Examples of Setting and Operation

Next, specific examples of setting and operation of the displacementmeasuring apparatus 1 are described. FIG. 25 is a flowchart showing aprocedure in the scanning mode of the displacement measuring apparatus1.

Procedure in Scanning Mode

In step SA1 in the flowchart in the scanning mode, an external trigger,an internal trigger, and other conditions are set, whereby what mannerof movement is activated by what kind of a trigger signal is set. Afterthe trigger conditions are set, the setting information is sent to theslave amplifier 3 and the sensor head 2, and the sensor head 2 movesfollowing these conditions.

In step SA2, brightness of a luminance image is set. The brightness isset by setting an exposure time, a quantity of illumination light, animaging mode or existence of HDR, and other parameters. The “HDR”represents a high dynamic range process. The brightness may be setautomatically or manually. A luminance image of the measurement object Wobtained at this time is shown in FIG. 26.

In step SA3, master data is registered. The master data isthree-dimensional data or height data of a luminance image and of thewhole field of view. The sensor head 2 obtains a luminance image of ameasurement object W and measures a displacement by scanning the wholemeasurement object W by using the measurement light, thereby obtainingheight data. The luminance image and the height data are made tocorrespond to each other and are stored in the height image storage 320b shown in FIG. 7. In step SA3, scanning may be performed at differentpitches by using the measurement light to obtain multiple pieces ofheight data. The multiple pieces of the height data are obtained by eachtype of a method. For example, scanning is performed at thepredetermined smallest pitch by using the measurement light to obtainfirst height data, and height data for a pitch that is rougher than thesmallest pitch or for a pitch of low resolution may be generated byreducing data contained in the first height data. Moreover, the masterregistration may be omitted.

In step SA4, for example, the measurement tool selection interface 80 asshown in FIG. 15 is displayed on the display 8, to allow selection ofthe measurement tool. In response to selection of the measurement tool,the procedure advances to step SA5, and setting of each tool isperformed. The order of setting the measurement tools is not specified,but setting of the position correction tool is performed first. Oneposition correction tool may be set for all of the other measurementtools, or a position correction tool may be set individually withrespect to each of the other measurement tools.

Whether addition of the measurement tool is completed is determined instep SA6. If addition of the measurement tool is still not completed,the measurement tool is added through steps SA4 and SA5. After additionof the measurement tool is completed, the procedure advances to stepSA7. In step SA7, output assignment is set. Thereafter, a comprehensivedetermination condition is set in step SA8.

Master Registration in Scanning Mode

Next, details of the master registration in the scanning mode aredescribed. In response to pressing a master registration start button 70b of the user interface 70 as shown in FIG. 26, master registrationstarts. In step SB1 in a master registration flowchart shown in FIG. 27,the first to the fourth light emitting diodes 31 to 34 of theilluminator 30 are lighted. In step SB2, a luminance image is imaged.The image data is stored in, for example, an image data storage 320 d ofthe slave amplifier 3. The image data storage 320 d is shown in FIG. 7.

In step SB3, the MEMS mirror 15 is controlled so as to be able tomeasure displacements of the whole measurement object Win the luminanceimage. In step SB4, strip-shaped measurement light is emitted from thelaser output unit 12 to irradiate the measurement object W. An image isobtained in step SB5, and a displacement is measured in step SB6. Thedisplacement may be measured by the sensor head 2 without transferringthe image obtained at that time, to the slave amplifier 3. The processesuntil the process for calculating a coordinate of a peak position fromthe image imaged in step SB5 may be performed by the sensor head 2, andcalculation of an actual measurement value from the peak position may beperformed by the slave amplifier 3.

In step SB7, master height data 1 is generated by using all pieces ofthe measurement data, and height data is mapped with respect to eachpixel of the luminance image. In step SB8, whether 2N-th measurement isperformed is determined. If the 2N-th measurement is performed, theprocedure advances to step SB9, and otherwise, if the 2N-th measurementis not performed, the procedure advances to step SB12. In step SB9,master height data 2 is generated by using only the data of the 2N-thmeasurement, and height data is mapped with respect to each pixel of theluminance image. In step SB10, whether 4N-th measurement is performed isdetermined. If the 4N-th measurement is performed, the procedureadvances to step SB11, and otherwise, if the 4N-th measurement is notperformed, the procedure advances to step SB12. In step SB11, masterheight data 3 is generated by using only the data of the 4N-thmeasurement, and height data is mapped with respect to each pixel of theluminance image. The processes in steps SB7, SB9, and SB11 may beperformed in parallel.

Whether the measurement is completed is determined in step SB12. If themeasurement is still not completed, the procedure advances to step SB3,and the steps of the procedure are performed again. If the measurementis completed, the procedure advances to step SB13. Height data at ablind spot is not generated in the measurement using triangulation. Inview of this, each pixel of the luminance image in which the height datais not obtained is shown on the display 8 by red oblique lines. Thesepixels are shown in FIG. 28 by the oblique lines. The master height data1 to 3 may be stored in the height data storage 320 b shown in FIG. 7.

Use of Master Height Data

Next, use of the master height data 1 to 3 is described with referenceto a flowchart shown in FIG. 29. The master height data 1 to 3 are usedin selecting the measurement tool. In step SC1, master height data to beused is selected from among the master height data 1 to 3 in accordancewith the type of the measurement tool and setting of the measurementtool. In step SC2, a measurement value is calculated from the selectedmaster height data, and the measurement position and the measurementrange of the measurement tool. In step SC3, the value measured in stepSC2 is displayed on the display 8.

In the case of using the height difference tool, as shown in FIG. 30, inresponse to designation of two positions, for example, a point A and apoint B, a height difference between the two points is displayed interms of numerical value in a measured value display part 70 c that isprovided at an upper part of the user interface 70. After the twopositions are designated, a displacement measurement range of each ofthe two positions may be set, as shown in FIG. 31. A region 70 d forsetting a displacement measurement range of the point A and a region 70e for setting a displacement measurement range of the point B aredisplayed in the user interface 70, thereby enabling individuallysetting the displacement measurement ranges of the points A and B.

In the case of using an area tool, as shown in FIG. 32, surfaces thatare in a predetermined color range are colored in the same color and aredisplayed. The area tool is a measurement tool for extracting a featurefrom the luminance image and is an example of a generally called imageprocessing tool. In the case in FIG. 32, whether a surface is in thepredetermined color range is determined by the area tool. In addition,an edge tool for extracting an edge from a luminance image to measurethe edge width may be used. It is possible to set both of such an imageprocessing tool and the displacement measurement tool for measuring adisplacement, in one luminance image in this embodiment.

After setting of the measurement tool is completed in the scanning mode,as shown in FIG. 33, a list of the selected measurement tools isdisplayed in a measurement tool display region 70 f that is provided ona side of the user interface 70.

Setting of Output Assignment

In setting the output assignment, assigning of data to output pins foroutputting the data to the outside is set, as shown in FIG. 34.Information such as “OFF”, “Comprehensive determination”, “Busy”,“Error”, and “Result of tool 1” may be selected, but other informationmay also be selected.

Setting of Comprehensive Determination Condition

As shown in FIG. 35, “All OK” or “Any one is OK” relating to the resultsof the measurement tools is selected in a determination conditionsetting region 70 g. In another case, a combination pattern by which thecomprehensive determination result is OK when a result of a measurementtool 1 is OK although a result of a measurement tool 2 is NG may be set.

After these settings are finished, the displacement measuring apparatus1 shifts from the setting mode to the operation mode and startsoperation. Setting information is output to the sensor head 2, and onlyRAM values of a volatile memory are rewritten, until the settings arefinished. After the settings are finished, the setting information iswritten as ROM values of a nonvolatile memory. The word “operation”represents operating the displacement measuring apparatus 1 in ameasurement site.

Halation Reducing Function

The displacement measuring apparatus 1 has a halation reducing functionfor reducing white areas in a luminance image. That is, imaging of aluminance image by using a light emitting diode may cause halation in acase of using a measurement object W that reflects regularly. Thisproblem may be solved by attaching the polarization filter attachment52, but the fitted polarization filter 52 a can decrease a quantity ofreceived measurement light. Alternatively, halation may be reduced byusing a dome light, but the dome light tends to be large in dimensionsand can disturb measurement.

From these points of view, instead of fitting the polarization filter 52a or using the dome light, a halation reducing function for reducinghalation is equipped in this embodiment. The polarization filter 52 aand the dome light may also be used. One or both of the polarizationfilter 52 a and the dome light and the halation reducing function may beused in combination.

The halation reducing function may be equipped to the slave amplifier 3or the sensor head 2. First, the measurement controller 305 controls toindividually light the light emitting diodes 31 to 34 of the illuminator30. The displacement measurement light receiver 40 outputs multiplereceived-light quantity distributions that are obtained by theindividual lighting of the light emitting diodes 31 to 34. The luminanceimage generator 302 generates a composite luminance image in whicheffects of halation are reduced, on the basis of the multiplereceived-light quantity distributions. In more detail, multiple imagesthat are obtained by emitting illumination light from differentdirections are composited, thereby reducing or removing halation.

FIG. 36 shows a flowchart of a halation reduction process. In step SD1,lighting pattern of the first to the fourth light emitting diodes 31 to34 is controlled. The lighting pattern is controlled to sequentiallylight the first to the fourth light emitting diodes 31 to 34. In stepSD2, only the first light emitting diode 31 is lighted, only the secondlight emitting diode 32 is lighted, only the third light emitting diode33 is lighted, and then only the fourth light emitting diode 34 islighted. In step SD3, the displacement measurement light receiver 40outputs a received-light quantity distribution, for example, while onlythe first light emitting diode 31 is lighted, and this received-lightquantity distribution is temporarily stored. In step SD4, whether thedisplacement measurement light receiver 40 outputs a received-lightquantity distribution with respect to each of the first to the fourthlight emitting diodes 31 to 34 is determined. The displacementmeasurement light receiver 40 also outputs a received-light quantitydistribution while only the second light emitting diode 32 is lighted,and this received-light quantity distribution is temporarily stored. Thedisplacement measurement light receiver 40 also outputs a received-lightquantity distribution while only the third light emitting diode 33 islighted, and this received-light quantity distribution is temporarilystored. The displacement measurement light receiver 40 further outputs areceived-light quantity distribution while only the fourth lightemitting diode 34 is lighted, and this received-light quantitydistribution is temporarily stored. Thus, data constituting fourluminance images are obtained.

Thereafter, the procedure advances to step SD5. In this embodiment, fourluminance images are obtained by emitting illumination light fromrespective four directions, whereby four kinds of data are generated.Thus, four luminance values exist in each pixel. The brightest valueamong the four luminance values highly possibly represents halation. Inview of this, the brightest value is excluded, and the second to thefourth brightest values are used to generate a composite image in stepSD5. This provides a luminance image in which halation is reduced orremoved.

Obtaining of Peak Position

FIG. 37 is a flowchart showing a procedure for obtaining a peak positionin a received-light quantity distribution acquired when the measurementlight irradiates a measurement position of the measurement object W. Instep SE1, designation of a measurement position of a measurement objectW is received. This is performed by the setting unit 304. In step SE2,an imaging range covering the measurement position and the vicinity ofthe measurement position, that is, a displacement measurement range isdesignated. In step SE3, the MEMS mirror 15 is controlled to enablemeasurement of a displacement in the displacement measurement rangecontaining the measurement position. In step SE4, strip-shapedmeasurement light is emitted from the laser output unit 12 to irradiatethe measurement object W.

In step SE5, the displacement measurement light receiver 40 performsimaging. In step SE6, a coordinate of the peak position of themeasurement light is calculated from the received-light quantitydistribution output from the displacement measurement light receiver 40.In step SE8, imaging is performed by the one-dimensional light receivingelement 22 a. The imaging that is performed by the displacementmeasurement light receiver 40 and the imaging that is performed by theone-dimensional light receiving element 22 a are executed atapproximately the same time. This reduces a measurement error. In stepSE9, the angle of the scanning mirror is calculated by the anglemeasuring unit 22 b, as described above. Thereafter, in step SE9, aheight or a displacement is calculated by using the principle oftriangulation on the basis of the peak position of the measurement lightand the angle of the scanning mirror, which is an irradiation angle ofthe measurement light from the scanning mirror. As described above, theheight or displacement may be calculated by using calibration data onthe basis of the X coordinate at the peak position of the measurementlight. This enables more accurate calculation of height in considerationof variations in temperature characteristics and changes with time.

Tilt Correction Function

The displacement measuring apparatus 1 has a tilt correction functionfor correcting a tilt of a flat reference plane. The tilt correctionfunction may be equipped to the slave amplifier 3 or the sensor head 2.In response to pressing a reference plane setting button 70 h in a statein which a luminance image is displayed in the user interface 70 asshown in FIG. 38, a height image is displayed in the user interface 70as shown in FIG. 39. The height image is an image that is coloreddepending on height. For example, an image may be made to contain a partthat is lighter as the height is higher and a part that is darker as theheight is lower, or an image may be made to contain a part that isredder as the height is higher and a part that is bluer as the height islower. A height image shown in FIG. 39 tilts such that the referenceplane is lower as it goes downward in the display 8.

A user sets a reference plane in the height image as shown in FIG. 39.The reference plane is specified by designating three points. In thisexample, a first point 91, a second point 92, and a third point 93 aredesignated by operating the input unit 9. The size of each of the points91 to 93 is changeable by operating a size setting part 94, and forexample, it may be small, normal, or large.

After the first to the third points 91 to 93 are designated, a signalprocessor of the slave amplifier 3 or the sensor head 2 calculates adisplacement at each pixel so that the first to the third points 91 to93 will have the same height. This calculation results in making thedesignated points have the same height as shown in FIG. 40.

Optimization of Pitch of Measurement Light

FIGS. 41A to 41C are diagrams for explaining a method of optimizing anirradiation pitch of the measurement light in accordance with adirection of a reference plane. The reference symbol 200 denotes areference plane, the reference symbol 201 denotes a displacementmeasurement range, and the reference symbol 202 denotes measurementlight.

FIG. 41A shows a situation in which five rays of the measurement light202 are emitted to a horizontal reference plane 200 in the displacementmeasurement range 201. FIG. 41B shows a situation in which the referenceplane 200 tilts upward to the right. In this situation, if the pitch ofthe measurement light 202 is the same as that in the case in FIG. 41A,only three rays of the measurement light 202 are emitted in thedisplacement measurement range 201, which can cause decrease inmeasurement accuracy. In this example, pitch changing control isperformed to change the pitch of the measurement light 202 in accordancewith the tilt of the reference plane 200. As shown in FIG. 41C, in thecase in which the reference plane 200 tilts, the pitch of themeasurement light 202 is narrowed so that the displacement measurementrange 201 will be irradiated with the same number of rays of themeasurement light 202 as the number of rays in the case in which thereference plane 200 is horizontal. This suppresses decrease inmeasurement accuracy. This process may be performed after the referenceplane is determined by the tilt correction.

Correction of Height of Reference Plane

FIGS. 42A and 42B are drawings for explaining an overview of correctinga height of a reference plane. The reference symbol 200 denotes areference plane, the reference symbol 201 denotes a displacementmeasurement range, the reference symbol 202 denotes measurement light,and the reference symbol 203 denotes a measurement range. It is assumedthat a measurement object W is placed on a pedestal. In measuring a topsurface of the measurement object W, a height variation of themeasurement object W relative to the pedestal in each of upper and lowerdirections may be small and may be, for example, 5 mm. However, in acase in which the height variation of the pedestal in each of the upperand lower directions is, for example, 20 mm, the measurement range of 25mm in each of the upper and lower directions should be set in total,which can cause increase in measurement time.

In this example, after the tilt is corrected by using the pedestal as areference plane, it is enough to measure only the measurement range 203relative to the reference plane 200, and measurement is performed foronly a height of 5 mm in each of the upper and lower directions. Thisshortens measurement time.

Designated-Height Area Tool

The designated-height area tool measures a height in a measurement toolregion, extracts a part with the height within a designated height rangeas an area, and displays the result. In measuring a height in themeasurement tool region, a scanning range of the measurement light tendsto be wide, thereby increasing the measurement time. On the other hand,the designated-height area tool dispenses with measurement of everyheight in the measurement tool region and checking whether the everyheight is in the designated height range, and the designated-height areatool enables measurement only in the designated height range andextraction of the measured part as an area. With this tool, themeasurement speed is increased by performing measurement only in thedesignated height range.

A specific example is described with reference to images shown in FIGS.43 to 45 and a flowchart shown in FIG. 46. In step SF1 of the flowchartshown in FIG. 46, a luminance image is displayed in the user interface70 as shown in FIG. 43. In step SF2 in FIG. 46, designation of aposition of a measurement tool region 210 is received, whereby themeasurement tool region 210 is set as shown in FIG. 43. The measurementtool region 210 is set in a manner similar to that for setting theregion 74 for position correction.

In step SF3 in FIG. 46, designation of a position of a part to beextracted as an area is received. This may be performed by the settingunit 304. More specifically, a user designates a part to be extracted asan area by using a stylus 211 or other tool, as shown in FIG. 44. Instep SF4, an extraction range is expanded so as to cover a height at thedesignated pixel that is to be extracted. In step SF5, pixels in theextraction range are displayed in color. In step SF6, whether setting ofthe designated-height area tool is completed is determined. If settingof the designated-height area tool is still not completed, the procedurereturns to step SF3, designation of a position of apart to be extractedis received for a second time. Thereafter, the procedure advances tostep SF4, and the extraction range is expanded. Furthermore, theprocedure advances to step SF5, pixels in the expanded extraction rangeare displayed in color. As a result, the pixels that are displayed incolor are increased in FIG. 45, compared with those in the image in FIG.44. The designation of the position of a part to be extracted may beperformed three or more times. After setting of the designated-heightarea tool is completed, the setting content is stored in step SF7. Thismakes an upper limit value and a lower limit value of the extractionrange be stored as setting values of the program. During operation, thestored upper limit value and the stored lower limit value are read, andan angle of the MEMS mirror 15 to be controlled is determined.

The method of setting the extraction range is not limited to the methodusing the stylus 211, and the extraction range may be set by operatingan extraction range setting part 211 as shown in FIG. 44 or 45. Theextraction range is expanded in response to pressing the “plus” buttonand is reduced in response to pressing the “minus” button.

Operation in Scanning Mode

FIG. 47 is a flowchart showing a procedure in operating the scanningmode of the displacement measuring apparatus 1. In step SG1 of theflowchart of operation in the scanning mode, an external trigger isreceived from the external device 6 or other device. In step SG2, thefirst to the fourth light emitting diodes 31 to 34 of the illuminator 30are lighted. In step SG3, a luminance image is imaged. The image data isstored in, for example, the image data storage 320 d of the slaveamplifier 3. The image data storage 320 d is shown in FIG. 7.

In step SG4, whether the position correction tool is applied isdetermined. If the position correction tool is selected at the time ofsetting, the procedure advances to step SG5, and if the positioncorrection tool is not selected at the time of setting, the procedureadvances to step SG7. The position correction tool is executed in stepSG5, and the position of the measurement tool, that is, the measurementposition is corrected in step SG6. The processes in steps SG5 and SG6are performed by the position corrector 307.

In step SG7, whether the image processing tool is applied is determined.If the image processing tool is selected at the time of setting, theprocedure advances to step SG8, and if the image processing tool is notselected at the time of setting, the procedure advances to step SG9. Instep SG8, each type of image processing is executed. An example of theimage processing includes one that is conventionally known.

In step SG9, whether real-time tilt correction is applied is determined.If execution of the tilt correction function is selected at the time ofsetting, the procedure advances to step SG10, and if execution of thetilt correction function is not selected at the time of setting, theprocedure advances to step SG18. In step SG10, the MEMS mirror 15 iscontrolled to enable measurement of a displacement in the displacementmeasurement range containing the measurement position. In step SG11,strip-shaped measurement light is emitted from the laser output unit 12to irradiate a measurement object W. Imaging is performed in step SG12,and a displacement is measured in step SG13.

In step SG14, whether measurement at each of the first to the thirdpoints 91 to 93 shown in FIG. 39 is completed is determined. If not allof the measurements at the first to the third points 91 to 93 arecompleted, the previous processes are repeated until measurements at thethree points are completed. After all measurements at the first to thethird points 91 to 93 are completed, the procedure advances to stepSG15, and a reference plane is calculated by using the first to thethird points 91 to 93. Thereafter, the procedure advances to step SG16,an irradiation pitch of the measurement light in the displacementmeasurement range is optimized in accordance with the direction of thereference plane. In step SG17, a scanning range of the measurement lightis optimized in accordance with the height of the reference plane.

In step SG18, whether the measurement tool is applied is determined. Ifthe measurement tool is selected at the time of setting, the procedureadvances to step SG19, and if the measurement tool is not selected atthe time of setting, the procedure advances to step SG24. In step SG19,depending on the type of the measurement tool, the MEMS mirror 15 iscontrolled to enable measurement of a displacement in the displacementmeasurement range containing the measurement position. In step SG20,strip-shaped measurement light is emitted from the laser output unit 12to irradiate the measurement object W. Imaging is performed in stepSG21, and a displacement is measured in step SG22. If all measurementsare completed in step SG23, the procedure advances to step SG24, and ifnot all of the measurements are completed, the previous measurement isrepeated. In step SG24, all results of the processes of the measurementtools are integrated to generate a comprehensive determination result.The generated comprehensive determination result is output.

Approximate Searching and Precise Measurement Processing

FIG. 48 is a basic flowchart of approximate searching and precisemeasurement processing. After the approximate searching processing isperformed by using the measurement light represented by the solid linesshown in FIG. 18A or 18B, precise measurement is performed by using themeasurement light represented by the dashed lines shown in FIG. 18A or18B.

In step SH1, a range of the approximate searching and a pitch of themeasurement light are determined. In this embodiment, this pitch isgreater than a pitch in the precise measurement and differs depending onthe size of the displacement measurement range. The precise measurementwill be described later. In step SH2, the approximate searching in whichthe pitch of the measurement light is large is executed. In step SH3, anapproximate height of the measurement object W is determined. In stepSH4, a range of the precise measurement and a pitch of the measurementlight are determined. The range of the precise measurement covers thedisplacement measurement range. The pitch of the measurement light isset to cause multiple rays of the measurement light to irradiate thedisplacement measurement range. In step SH5, the precise measurement isexecuted. In step SH6, an exact height of the measurement object W isdetermined.

FIG. 49 is a flowchart of the approximate searching and the precisemeasurement processing in which multiple patterns are executedalternately. In step SJ1, a scanning order of multiple patterns, forexample, a pattern A, a pattern B, and . . . , is determined. In stepSJ2, one pattern is selected from among the multiple patterns. In stepSJ3, a range of the approximate searching and a pitch of the measurementlight of the selected pattern are determined. In step SJ4, theapproximate searching in which the pitch of the measurement light islarge is executed. In step SJ5, an approximate height of the measurementobject W is determined. In step SJ6, a range of the precise measurementand a pitch of the measurement light are determined. In step SJ7, theprecise measurement is executed. In step SJ8, an exact height of themeasurement object W is determined. In step SJ9, whether scanning of allof the patterns is finished is determined, and the previous processesare repeated until scanning of all of the patterns is finished.

FIG. 50 is a flowchart of the approximate searching and the precisemeasurement processing in which multiple patterns are executed in theapproximate searching prior to the precise measurement processing. Instep SK1, a scanning order of the multiple patterns in the approximatesearching is determined. In step SK2, one pattern is selected from amongthe multiple patterns. In step SK3, a range of the approximate searchingand a pitch of the measurement light for the selected pattern aredetermined. In step SK4, the approximate searching in which the pitch ofthe measurement light is large is executed. In step SK5, an approximateheight of the measurement object W is determined. In step SK6, whetherall of the patterns in the approximate searching are finished isdetermined, and the previous processes are repeated until all of thepatterns in the approximate searching are finished.

After all of the patterns in the approximate searching are finished, theprocedure advances to step SK7, and a scanning order of the multiplepatterns in the precise measurement is determined. In step SK8, theprecise measurements are executed in the determined scanning order. Instep SK9, an exact height of the measurement object W is determined.

FIG. 51 is a flowchart of the approximate searching and the precisemeasurement processing in which multiple patterns are executedsimultaneously in the approximate searching. In step SL1, a range of theapproximate searching and a pitch of the measurement light thatcorrespond to all of the multiple patterns are determined. In step SL2,the approximate searching in which the pitch of the measurement light islarge is executed. In step SL3, an approximate height is determined withrespect to each of the patterns. In step SL4, a scanning order of themultiple patterns in the precise measurement is determined. In step SL5,one pattern is selected from among the multiple patterns. In step SL6, arange of the precise measurement and a pitch of the measurement lightare determined. In step SL7, the precise measurement is executed. Instep SL8, an exact height of the measurement object W is determined. Instep SL9, whether scanning of all of the patterns is finished isdetermined, and the previous processes are repeated until scanning ofall of the patterns is finished.

FIG. 52 is a flowchart of the approximate searching and the precisemeasurement processing in which the procedure advances to the precisemeasurement at the time height information of the measurement object Wis obtained during the approximate searching. In step SM1, a range ofthe approximate searching and a pitch of the measurement light aredetermined. In step SM2, the approximate searching in which the pitch ofthe measurement light is large is started. In step SM3, positions forthe approximate searching are sequentially scanned. In step SM4, whetherthe measurement position is identified is determined. If the measurementposition is not identified, the procedure returns to step SM3, and thepositions for the approximate searching are sequentially scanned. If themeasurement position is identified, the procedure advances to step SM5,and a range of the precise measurement and a pitch of the measurementlight with respect to the identified measurement position aredetermined. In step SM6, the precise measurement is executed. In stepSM7, an exact height of the measurement object W is determined.

FIG. 53 is a flowchart of the approximate searching and the precisemeasurement processing in which a measurement position is determinedfrom both results of the approximate searching and the precisemeasurement. In step SN1, a range of the approximate searching and apitch of the measurement light are determined. In step SN2, theapproximate searching in which the pitch of the measurement light islarge is started. In step SN3, height information at the measurementposition, which is obtained by the approximate searching, is recorded.In step SN4, a range of the precise measurement and a pitch of themeasurement light are determined. In step SN5, the precise measurementis executed. In step SN6, the height of the measurement object W isdetermined from the height information, which is obtained by theapproximate searching in step SN3, and the result of the precisemeasurement, which is obtained in step SN5.

Procedure in Line Mode

FIG. 54 is a flowchart in the line mode. A step for setting an externaltrigger, an internal trigger, or other conditions is omitted in thisflowchart. In step SP1, brightness of a luminance image is set. In stepSP2, master data is registered. In step SP3, a measurement tool isselected. After the measurement tool is selected, the procedure advancesto step SP4, and setting of each tool is performed. Whether addition ofthe measurement tool is completed is determined in step SP5. If additionof the measurement tool is still not completed, the measurement tool isadded through steps SP3 and SP4. After addition of the measurement toolis completed, the procedure advances to step SP6. In step SP6, outputassignment is set. Thereafter, a comprehensive determination conditionis set in step SP7. As in the case of the scanning mode, registration ofthe master data in step SP2 may be omitted.

As shown in FIG. 55, a virtual measurement emission line 220 isdisplayed in a manner superimposed on a luminance image displayed in theuser interface 70. The measurement emission line 220 indicates a partirradiated with the measurement light and is displayed so as tocorrespond to the position of irradiation of the measurement light.

FIG. 56 shows a state in which a displacement measurement range 221 isset by using the height tool in the line mode. It is possible to set thedisplacement measurement range 221 on the measurement emission line 220.A mark 221 a with an arrow shape at each side of the displacementmeasurement range 221 is controlled to change the length and theposition of the displacement measurement range 221.

FIG. 57 shows a state in which a displacement measurement range 221 isset by using the height difference tool in the line mode. It is possibleto set two positions, for example, a point A and a point B, on themeasurement emission line 220. In response to designation of the pointsA and B, a height difference between the two points is displayed interms of numerical value in the measured value display part 70 c that isprovided at the upper part of the user interface 70.

Master Registration in Line Mode

Next, details of the master registration in the line mode are described.In step SQ1 in a master registration flowchart shown in FIG. 58, thefirst to the fourth light emitting diodes 31 to 34 of the illuminator 30are lighted. In step SQ2, a luminance image is imaged. In step SQ3, theMEMS mirror 15 is controlled to enable measurement of displacements ofthe whole measurement object Win the whole luminance image. In step SQ4,strip-shaped measurement light is emitted from the laser output unit 12to irradiate the measurement object W. An image is obtained in step SQ5,and a displacement is measured in step SQ6.

In step SQ7, height data is mapped with respect to each pixel of theluminance image. In step SQ8, each pixel having no height data among thepixels of the luminance image is shown on the display 8 by red obliquelines.

Operation in Line Mode

FIG. 59 is a flowchart showing a procedure in operating the line mode ofthe displacement measuring apparatus 1. In step SR1 in the flowchart ofoperation in the line mode, a trigger signal is output periodically. Instep SR2, the first to the fourth light emitting diodes 31 to 34 of theilluminator 30 are lighted. In step SR3, a luminance image is imaged. Instep SR4, the MEMS mirror 15 is controlled to enable measurement of adisplacement in the displacement measurement range containing themeasurement position. In step SR5, strip-shaped measurement light isemitted from the laser output unit 12 to irradiate the measurementobject W. Imaging is performed in step SR6, and a displacement ismeasured in step SR7.

In step SR8, whether the position correction tool is applied isdetermined. If the position correction tool is selected at the time ofsetting, the procedure advances to step SR9, and if the positioncorrection tool is not selected at the time of setting, the procedureadvances to step SR11. The position correction tool is executed in stepSR9, and the position of the measurement tool, that is, the measurementposition is corrected in step SR10.

In step SR11, whether the measurement tool is applied is determined. Ifthe measurement tool is selected at the time of setting, the procedureadvances to step SR12, and if the measurement tool is not selected atthe time of setting, the procedure advances to step SR13. In step SR12,the measurement tool is executed. When all measurements are completed,all results of the processes of the measurement tools are integrated togenerate a comprehensive determination result in step SR13. Thegenerated comprehensive determination result is output.

Effects of Embodiment

In this embodiment, a measurement position at which a displacement is tobe measured is set in a luminance image displayed on the display 8, andthe measurement position is irradiated with the measurement light. Themeasurement light is reflected back from the measurement position and isreceived by the displacement measurement light receiver 40, therebyproviding a received-light quantity distribution for displacementmeasurement. On the basis of this received-light quantity distributionfor displacement measurement, a displacement at the measurement positionis measured. Thus, it is not necessary to scan the whole measurementobject W by using the measurement light, to measure thethree-dimensional shape of the measurement object W. This enablesshort-time measurement of a displacement at a predetermined position ofthe measurement object W.

In operation of the displacement measuring apparatus 1, the position andthe posture of the measurement object W are determined by using positioncorrection information, and the measurement position is corrected. Themeasurement light is emitted to the corrected measurement position tomeasure a displacement at the corrected measurement position. Thisenables short-time measurement of a displacement at a predeterminedposition of the measurement object W even when the position or theposture of the measurement object W is changed.

A first irradiation angle of the scanning mirror at the time themeasurement light is emitted to a measurement position is determinedwhile the measurement light scans in the first scanning range.Thereafter, a second irradiation angle of the scanning mirror at thetime the measurement light is emitted to the measurement position isdetermined while the scanning mirror is moved in a second scanning rangethat covers the first irradiation angle and that is smaller than thefirst scanning range. In these conditions, a displacement at themeasurement position is measured on the basis of the second irradiationangle and the position in the second direction of the measurementposition. This enables measuring a displacement at a predeterminedposition of the measurement object W for a short time at a highaccuracy.

The irradiation angle of the scanning mirror at the time the measurementlight is emitted to the measurement position is determined, and adisplacement at the measurement position is measured on the basis of theirradiation angle and the peak position of the received-light quantitydistribution acquired when the measurement light is emitted to themeasurement position. This enables short-time measurement of adisplacement at a predetermined position of the measurement object W.

In the case in which the scanning mode is selected, the measurementlight is sequentially emitted to different positions in the seconddirection of the measurement object W. In the case in which the linemode is selected, the measurement light is emitted to the same positionsof the measurement object W. Thereafter, a displacement of themeasurement object W is measured on the basis of the received-lightquantity distribution output from the displacement measurement lightreceiver 40. Thus, a displacement at a predetermined position ismeasured in each of the cases in which the measurement object W remainsstationary and in which the measurement object W moves.

The forgoing embodiment is merely an illustration in every aspect andshould not be limitedly understood. Moreover, all modifications andalterations belonging to equivalents of the claims are considered tofall within the scope of the present invention.

As described above, the displacement measuring apparatus according tothe present invention can be used in measuring a displacement at apredetermined position of each type of a measurement object.

What is claimed is:
 1. A displacement measuring apparatus for measuringa displacement at a predetermined position of a measurement object, thedisplacement measuring apparatus comprising: a light projector includinga measurement light source and a light projection lens that receiveslight from the measurement light source, and the light projectorconfigured to emit strip-shaped measurement light extending in a firstdirection, to the measurement object; a scanning part configured toperform scanning using the measurement light in a second directioncrossing the first direction; a light receiver including atwo-dimensional light receiving element, the two-dimensional lightreceiving element configured to output a received-light quantitydistribution for displacement measurement in response to receiving themeasurement light that is reflected back from the measurement object,and the two-dimensional light receiving element further configured tooutput a received-light quantity distribution for image generation inresponse to receiving light that is reflected back from the measurementobject; a luminance image generator configured to generate a luminanceimage of the measurement object on a basis of the received-lightquantity distribution for image generation; a setting unit configured toreceive setting of a measurement position at which a displacement ismeasured in a range scannable by the scanning part, and the setting unitfurther configured to receive setting of a region for positioncorrection, by which the measurement position is corrected, in theluminance image generated by the luminance image generator; a correctioninformation storage configured to store position correction informationin the region and store relative position information between the regionand the measurement position set by the setting unit; a positioncorrector configured to, in operating the displacement measuringapparatus, determine a position and a posture of the measurement objectby using the position correction information stored in the correctioninformation storage, in a luminance image that is newly generated by theluminance image generator, to correct the measurement position by usingthe relative position information; a measurement controller configuredto control the light projector and the scanning part to cause themeasurement light to irradiate the measurement position that iscorrected by the position corrector; and a displacement measuring unitconfigured to measure the displacement at the measurement position on abasis of the received-light quantity distribution for displacementmeasurement, and the received-light quantity distribution fordisplacement measurement being output from the light receiver when thelight receiver receives the measurement light that is emitted to and isreflected back from the measurement position corrected by the positioncorrector.
 2. The displacement measuring apparatus according to claim 1,wherein the position correction information is a part of the luminanceimage.
 3. The displacement measuring apparatus according to claim 1,wherein the position correction information is edge information of theluminance image.
 4. The displacement measuring apparatus according toclaim 1, further comprising an edge extracting unit configured toextract an edge of the measurement object in the luminance image, andthe position correction information being edge information relating tothe edge extracted by the edge extracting unit.
 5. The displacementmeasuring apparatus according to claim 4, further comprising a displayconfigured to display the edge, which is extracted by the edgeextracting unit, in a manner superimposed on the luminance image.
 6. Thedisplacement measuring apparatus according to claim 1, wherein thesetting unit is configured to set a displacement measurement range inwhich a displacement at the measurement position is measured, thedisplacement measuring apparatus further comprises a display that isconfigured to display the luminance image so that an X coordinate in theluminance image is a coordinate in the first direction whereas a Ycoordinate in the luminance image is a coordinate in the seconddirection, and the measurement controller is configured to control thelight projector and the scanning part to cause the measurement light toirradiate the measurement position that is corrected by the positioncorrector, on a basis of the Y coordinate of the measurement positioncorrected by the position corrector as well as the displacementmeasurement range set by the setting unit.
 7. The displacement measuringapparatus according to claim 6, wherein the measurement controller isfurther configured to control the light projector and the scanning parton a basis of the X coordinate of the measurement position corrected bythe position corrector as well as the displacement measurement range setby the setting unit.
 8. The displacement measuring apparatus accordingto claim 1, further comprising an illuminator configured to emit uniformillumination light to the measurement object, after the illuminatoremits the uniform illumination light to the measurement object, and theluminance image generator generates the luminance image of themeasurement object, the light projector emits the measurement light tothe measurement object, and the light receiver outputs thereceived-light quantity distribution for displacement measurement, andafter the position corrector determines the position and the posture ofthe measurement object by using the position correction informationstored in the correction information storage, in the luminance imagenewly generated by the luminance image generator, and the positioncorrector corrects the measurement position by using the relativeposition information, the measurement controller controls the lightprojector and the scanning part to cause the measurement light toirradiate the measurement position corrected by the position corrector.9. The displacement measuring apparatus according to claim 1, furthercomprising a display configured to display the luminance image generatedby the luminance image generator, and the setting unit configured toreceive setting of the measurement position at which the displacement ismeasured and to receive setting of a region for position correction bywhich the measurement position is corrected, in the luminance imagedisplayed on the display.